QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#542975#8674. Riddle of the SphinxqwerasdfWA 1ms3824kbC++201.5kb2024-09-01 12:18:392024-09-01 12:18:39

Judging History

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

  • [2024-09-01 12:18:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3824kb
  • [2024-09-01 12:18:39]
  • 提交

answer

//#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
//using namespace atcoder; //https://github.com/atcoder/ac-library

#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define bit(n, k) ((n >> k) & 1)
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> pii;

void test_case(int tt){
    vector<int> a(5);
    cout<<"1 0 0"<<endl;
    cin>>a[0];
    cout<<"0 1 0"<<endl;
    cin>>a[1];
    cout<<"0 0 1"<<endl;
    cin>>a[2];
    cout<<"1 1 1"<<endl;
    cin>>a[3];
    cout<<"1 2 3"<<endl;
    cin>>a[4];
    int f1=0,f2=0;
    if(a[0]+a[1]+a[2]==a[3])f1=1;
    if(a[0]+2*a[1]+3*a[2]==a[4])f2=1;
    if(f1+f2>=1){
        cout<<a[0]<<' '<<a[1]<<' '<<a[2]<<endl;
    }
    else{
        if(a[0]!=a[3]-a[1]-a[2] && a[3]-a[1]-a[2]==a[4]-2*a[1]-3*a[2] && a[3]-a[1]-a[2]>=0){ // a false
            cout<<a[3]-a[1]-a[2]<<' '<<a[1]<<' '<<a[2]<<endl;
            return;
        }
        if(a[1]!=a[3]-a[0]-a[2] && a[3]-a[0]-a[2]==a[4]-a[0]-3*a[2] && a[3]-a[0]-a[2]>=0){ // b false
            cout<<a[0]<<' '<<a[3]-a[0]-a[2]<<' '<<a[2]<<endl;
            return;
        }
        if(a[2]!=a[3]-a[0]-a[1] && a[3]-a[0]-a[1]==a[4]-a[0]-2*a[1] && a[3]-a[0]-a[1]>=0){ // c false
            cout<<a[0]<<' '<<a[1]<<' '<<a[3]-a[0]-a[1]<<endl;
            return;
        }
    }
    return;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1;
    //cin>>t;
    rep(i, 1, t + 1)
    {
        test_case(i);
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3628kb

input:

1
2
3
6
14

output:

1 0 0
0 1 0
0 0 1
1 1 1
1 2 3
1 2 3

result:

ok correct!

Test #2:

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

input:

9998
1
1
10000
10003

output:

1 0 0
0 1 0
0 0 1
1 1 1
1 2 3
9998 1 1

result:

ok correct!

Test #3:

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

input:

3333
3333
3333
9999
19998

output:

1 0 0
0 1 0
0 0 1
1 1 1
1 2 3
3333 3333 3333

result:

ok correct!

Test #4:

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

input:

892
503
712
2108
4035

output:

1 0 0
0 1 0
0 0 1
1 1 1
1 2 3
893 503 712

result:

ok correct!

Test #5:

score: -100
Wrong Answer
time: 0ms
memory: 3824kb

input:

868
365
947
2182
4443

output:

1 0 0
0 1 0
0 0 1
1 1 1
1 2 3

result:

wrong answer format  Unexpected end of file - int32 expected