QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#561786#8674. Riddle of the SphinxStarrykillerWA 1ms3800kbC++23751b2024-09-13 10:28:192024-09-13 10:28:20

Judging History

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

  • [2024-09-13 10:28:20]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3800kb
  • [2024-09-13 10:28:19]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

signed main() {
    int a, b, c, d, e;
    cout<<"1 0 0"<<endl;
    cin>>a;
    
    cout<<"0 1 0"<<endl;
    cin>>b;
    
    cout<<"0 0 1"<<endl;
    cin>>c;

    cout<<"1 0 1"<<endl;

    cin>>d;

    cout<<"1 1 1"<<endl;

    cin>>e;

    map<int,int>A,B,C;

    // 4,5
    A[a]+=2; B[b]+=2; C[c]+=2;
    
    // 1
    A[d-c]++; B[b]++; C[c]++;

    // 2
    A[a]++; B[e-d]++; C[c]++;

    // 3
    A[a]++; B[b]++; C[d-a]++;

    auto answer=[](map<int,int> mp) {
        int cnt=0, ans=0;
        for (auto [u,v]: mp) if (v>cnt) cnt=v, ans=u;
        return ans;
    };

    cout<<answer(A)<<" ";
    cout<<answer(B)<<" ";
    cout<<answer(C)<<" ";

}

详细

Test #1:

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

input:

1
2
3
4
6

output:

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

result:

ok correct!

Test #2:

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

input:

9998
1
1
9999
10000

output:

1 0 0
0 1 0
0 0 1
1 0 1
1 1 1
9998 1 1 

result:

ok correct!

Test #3:

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

input:

3333
3333
3333
6666
9999

output:

1 0 0
0 1 0
0 0 1
1 0 1
1 1 1
3333 3333 3333 

result:

ok correct!

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 3800kb

input:

892
503
712
1605
2108

output:

1 0 0
0 1 0
0 0 1
1 0 1
1 1 1
892 503 712 

result:

wrong answer read