QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#672604#2873. Extreme ProblemIllusionaryDominance#AC ✓1ms3776kbC++202.4kb2024-10-24 17:44:052024-10-24 17:44:07

Judging History

你现在查看的是最新测评结果

  • [2024-10-24 17:44:07]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3776kb
  • [2024-10-24 17:44:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define all(x) (x).begin(), (x).end()

string f[2][2][2];

ll func(ll x, ll y)
{
    return (x*x*x-12*x)*(y*y*y-12*y)+x+y;
}

void chk()
{
    int cnt0=0, cnt1=0, cnt2=0;
    ll mx=0;
    for(int i=-10;i<=10;++i) for(int j=-10;j<=10;++j)
    {
        if(max(abs(i), abs(j))<10)
        {
            if(func(i, j) > max({func(i-1, j), func(i+1, j), func(i, j-1), func(i, j+1)}))
                cout << "! max " << i << " " << j << "\n";
            if(func(i, j) < min({func(i-1, j), func(i+1, j), func(i, j-1), func(i, j+1)}))
                cout << "! min " << i << " " << j << "\n";
            cnt0+=func(i, j) > max({func(i-1, j), func(i+1, j), func(i, j-1), func(i, j+1)});
            cnt1+=func(i, j) < min({func(i-1, j), func(i+1, j), func(i, j-1), func(i, j+1)});
        }
        bool fl=1;
        if(i>-10) fl&=func(i, j)==func(i-1, j);
        if(i<10) fl&=func(i, j)==func(i+1, j);
        if(j>-10) fl&=func(i, j)==func(i, j-1);
        if(j<10) fl&=func(i, j)==func(i, j+1);
        if (fl) cout << "! eq " << i << " " << j << "\n";
        cnt2+=fl;
        mx = max(mx, abs(func(i, j)));
    }
    cerr << func(4, 2) << " "<< func(0, 1) << " "<< func(1, 2) << " " << func(0, 3) << " " << func(-1, 2) << "\n";
    cerr << func(9, 10) << " "<< func(10, 10) << " "<<mx << "\n";
    cout << (cnt0>1) << " " << (cnt1>1) << " " << (cnt2!=0) << "\n";
}

void init()
{
    f[0][0][0] = "x 3 - 4 ^ y -5 + 2 ^ +"; // 
    f[0][0][1] = "1"; // 
    f[0][1][0] = "x 2 ^ 4 - 2 ^ y 2 ^ 4 - 2 ^ +"; // 
    f[0][1][1] = "0 9 9 + 1 + x 3 ^ * 2 9 1 + * 7 + 9 1 + * 1 + x 2 ^ * - 1 - 1 y 9 - y 9 1 + - * y 2 + 2 ^ * y 2 - 2 ^ * + + -"; //
    f[1][0][0] = "0 x 2 ^ 4 - 2 ^ - y 2 ^ 4 - 2 ^ -"; // 
    f[1][0][1] = "9 9 + 1 + x 3 ^ * 2 9 1 + * 7 + 9 1 + * 1 + x 2 ^ * - 1 - 1 y 9 - y 9 1 + - * y 2 + 2 ^ * y 2 - 2 ^ * + -"; //
    // (x*x*x-12*x)*(10000ll-(y*y-4)*(y*y-4));
    f[1][1][0] = "x 3 ^ 9 3 + x * - y 3 ^ 9 3 + y * - * x + y +"; // 
    f[1][1][1] = "4 x 3 ^ * 6 9 * 3 + x * - 4 y 3 ^ * 6 9 * 3 + y * - *"; //
    // chk();
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    init();
    string s; int a, b, c;
    for(int i=1; i<=4; ++i) cin>>s; a=s=="Yes";
    for(int i=1; i<=4; ++i) cin>>s; b=s=="Yes";
    for(int i=1; i<=2; ++i) cin>>s; c=s=="Yes";
    cout << f[a][b][c] << "\n";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3632kb

input:

Multiple local maxima: No
Multiple local minima: No
Plateaus: No

output:

x 3 - 4 ^ y -5 + 2 ^ +

result:

ok OK

Test #2:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

Multiple local maxima: No
Multiple local minima: No
Plateaus: Yes

output:

1

result:

ok OK

Test #3:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

Multiple local maxima: No
Multiple local minima: Yes
Plateaus: No

output:

x 2 ^ 4 - 2 ^ y 2 ^ 4 - 2 ^ +

result:

ok OK

Test #4:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

Multiple local maxima: No
Multiple local minima: Yes
Plateaus: Yes

output:

0 9 9 + 1 + x 3 ^ * 2 9 1 + * 7 + 9 1 + * 1 + x 2 ^ * - 1 - 1 y 9 - y 9 1 + - * y 2 + 2 ^ * y 2 - 2 ^ * + + -

result:

ok OK

Test #5:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

Multiple local maxima: Yes
Multiple local minima: No
Plateaus: No

output:

0 x 2 ^ 4 - 2 ^ - y 2 ^ 4 - 2 ^ -

result:

ok OK

Test #6:

score: 0
Accepted
time: 1ms
memory: 3732kb

input:

Multiple local maxima: Yes
Multiple local minima: No
Plateaus: Yes

output:

9 9 + 1 + x 3 ^ * 2 9 1 + * 7 + 9 1 + * 1 + x 2 ^ * - 1 - 1 y 9 - y 9 1 + - * y 2 + 2 ^ * y 2 - 2 ^ * + -

result:

ok OK

Test #7:

score: 0
Accepted
time: 0ms
memory: 3472kb

input:

Multiple local maxima: Yes
Multiple local minima: Yes
Plateaus: No

output:

x 3 ^ 9 3 + x * - y 3 ^ 9 3 + y * - * x + y +

result:

ok OK

Test #8:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

Multiple local maxima: Yes
Multiple local minima: Yes
Plateaus: Yes

output:

4 x 3 ^ * 6 9 * 3 + x * - 4 y 3 ^ * 6 9 * 3 + y * - *

result:

ok OK