QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#852948 | #8674. Riddle of the Sphinx | arca | WA | 1ms | 3744kb | C++20 | 1.0kb | 2025-01-11 14:58:38 | 2025-01-11 14:58:45 |
Judging History
answer
#include <iostream>
int ask(int a, int b, int c) {
std::cout << a << " " << b << " " << c << std::endl;
int x;
std::cin >> x;
return x;
}
int k[5];
int main() {
std::ios::sync_with_stdio(0), std::cin.tie(0), std::cout.tie(0);
k[0] = ask(1, 1, 0);
k[1] = ask(0, 1, 1);
k[2] = ask(1, 0, 1);
k[3] = ask(1, 1, 1);
k[4] = ask(2, 2, 2);
if (k[3] * 2 == k[4]) {
int pa = k[3] - k[1];
int pb = k[3] - k[2];
int pc = k[3] - k[0];
if ((pa + pc < k[2]) == (pb + pc < k[1])) { // the given a+b is wrong
pc = k[3] - pa - pb;
} else if ((pa + pb < k[0]) == (pc + pb < k[1])) {
pb = k[3] - pa - pc;
} else {
pa = k[3] - pb - pc;
}
std::cout << pa << " " << pb << " " << pc << std::endl;
} else {
int a = (k[0] - k[1] + k[2]) / 2;
int b = k[0] - a;
int c = k[2] - a;
std::cout << a << " " << b << " " << c << std::endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3688kb
input:
3 5 4 6 12
output:
1 1 0 0 1 1 1 0 1 1 1 1 2 2 2 1 2 3
result:
ok correct!
Test #2:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
9999 2 9999 10000 20000
output:
1 1 0 0 1 1 1 0 1 1 1 1 2 2 2 9998 1 1
result:
ok correct!
Test #3:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
6666 6666 6666 9999 19998
output:
1 1 0 0 1 1 1 0 1 1 1 1 2 2 2 3333 3333 3333
result:
ok correct!
Test #4:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
1395 1215 1605 2108 4216
output:
1 1 0 0 1 1 1 0 1 1 1 1 2 2 2 893 503 712
result:
ok correct!
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3732kb
input:
1235 1312 1815 2182 4364
output:
1 1 0 0 1 1 1 0 1 1 1 1 2 2 2 870 367 945
result:
wrong answer read