QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#574909 | #8674. Riddle of the Sphinx | daduoli# | AC ✓ | 1ms | 3972kb | C++23 | 1.3kb | 2024-09-19 08:32:57 | 2024-09-19 08:32:57 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
inline int read(){
char ch=getchar();
while(!isdigit(ch) && ch!='-') ch=getchar();
int x=0,ff=1; if(ch=='-') ff=-1,ch=getchar();
while(isdigit(ch)) x=(x<<3) + (x<<1) + (ch^48),ch=getchar();
return x*ff;
}
int calc(int a,int b,int c){
printf("%d %d %d\n",a,b,c); fflush(stdout);
int x=read(); return x;
}
int main(){
int S=calc(1,1,1),A=calc(1,0,0),B=calc(0,1,0),C=calc(0,0,1);
if(A+B+C==S){
S=calc(1,1,1);
printf("%d %d %d\n",A,B,C); fflush(stdout);
} else {
int A2=S-B-C,B2=S-A-C,C2=S-A-B;
for(int i=0;i<=10;i++)
for(int j=0;j<=10;j++)
for(int k=0;k<=10;k++){
int w1=A*i+B*j+C*k,
w2=A2*i+B*j+C*k,
w3=A*i+B2*j+C*k,
w4=A*i+B*j+C2*k;
if(w1!=w2 && w1!=w3 && w1!=w4 && w2!=w3 && w2!=w4 && w3!=w4){
int ww=calc(i,j,k);
if(ww==w2) A=A2;
else if(ww==w3) B=B2;
else if(ww==w4) C=C2;
printf("%d %d %d\n",A,B,C); fflush(stdout);
return 0;
}
}
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3864kb
input:
6 1 2 3 6
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 2 3
result:
ok correct!
Test #2:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
10000 9998 1 1 10000
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 9998 1 1
result:
ok correct!
Test #3:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
9999 3333 3333 3333 9999
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 3333 3333 3333
result:
ok correct!
Test #4:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
2107 893 503 712 4035
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 893 503 712
result:
ok correct!
Test #5:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
2182 866 367 947 4443
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 868 367 947
result:
ok correct!
Test #6:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
2304 684 828 793 4717
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 684 827 793
result:
ok correct!
Test #7:
score: 0
Accepted
time: 1ms
memory: 3904kb
input:
771 308 23 438 1674
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 308 23 440
result:
ok correct!
Test #8:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
1956 705 910 341 1957
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 705 910 341
result:
ok correct!
Test #9:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
3066 1481 1285 299 4948
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1481 1285 299
result:
ok correct!
Test #10:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
5930 1517 3575 839 11183
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1516 3575 839
result:
ok correct!
Test #11:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
3513 2254 131 1127 5899
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 2254 132 1127
result:
ok correct!
Test #12:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
895 801 38 55 1045
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 801 38 56
result:
ok correct!
Test #13:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
6128 1004 1248 3876 6127
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1004 1248 3876
result:
ok correct!
Test #14:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
7513 2013 3884 1618 14635
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 2013 3884 1618
result:
ok correct!
Test #15:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
8103 1255 6633 214 15164
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1256 6633 214
result:
ok correct!
Test #16:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
5640 805 4143 693 11168
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 805 4142 693
result:
ok correct!
Test #17:
score: 0
Accepted
time: 0ms
memory: 3972kb
input:
6225 731 4440 1052 12773
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 731 4440 1054
result:
ok correct!
Test #18:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
7922 445 3442 4035 7923
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 445 3442 4035
result:
ok correct!
Test #19:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
5486 1 2 3 14
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1 2 3
result:
ok correct!
Test #20:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
6 1 2 3 6
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 2 3
result:
ok correct!
Test #21:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
6 1 3 3 14
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1 2 3
result:
ok correct!
Test #22:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
6 1 2 2602 14
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1 2 3
result:
ok correct!
Test #23:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
6 1 2 3 5
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 2 3
result:
ok correct!
Test #24:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
4161 9998 1 1 10003
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 9998 1 1
result:
ok correct!
Test #25:
score: 0
Accepted
time: 1ms
memory: 3760kb
input:
10000 9997 1 1 10003
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 9998 1 1
result:
ok correct!
Test #26:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
10000 9998 2488 1 10003
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 9998 1 1
result:
ok correct!
Test #27:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
10000 9998 1 1 10000
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 9998 1 1
result:
ok correct!
Test #28:
score: 0
Accepted
time: 1ms
memory: 3772kb
input:
10000 9998 1 1 6570
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 9998 1 1
result:
ok correct!
Test #29:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
9998 3333 3333 3333 19998
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 3333 3333 3333
result:
ok correct!
Test #30:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
9999 3333 3333 3333 9999
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 3333 3333 3333
result:
ok correct!
Test #31:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
9999 3333 3334 3333 19998
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 3333 3333 3333
result:
ok correct!
Test #32:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
9999 3333 3333 3333 9999
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 3333 3333 3333
result:
ok correct!
Test #33:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
9999 3333 3333 3333 10000
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 3333 3333 3333
result:
ok correct!
Test #34:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
3068 543 588 724 3891
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 543 588 724
result:
ok correct!
Test #35:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
2524 3040 961 783 5051
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 780 961 783
result:
ok correct!
Test #36:
score: 0
Accepted
time: 1ms
memory: 3916kb
input:
1191 690 189 312 1191
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 690 189 312
result:
ok correct!
Test #37:
score: 0
Accepted
time: 1ms
memory: 3792kb
input:
1357 97 289 972 3588
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 97 289 971
result:
ok correct!
Test #38:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
593 298 118 177 4623
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 298 118 177
result:
ok correct!
Test #39:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
6884 2974 1358 2553 13349
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 2974 1358 2553
result:
ok correct!
Test #40:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
9367 340 2158 3000 17525
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 4209 2158 3000
result:
ok correct!
Test #41:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
5706 1199 98 4408 14621
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1199 99 4408
result:
ok correct!
Test #42:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
4772 3601 167 1004 4772
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 3601 167 1004
result:
ok correct!
Test #43:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
7321 2721 2111 2489 7320
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 2721 2111 2489
result:
ok correct!
Test #44:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
1049 3697 203 5220 19763
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 3697 203 5220
result:
ok correct!
Test #45:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
4970 1587 2225 1264 9723
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1481 2225 1264
result:
ok correct!
Test #46:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
6712 4769 1302 391 9046
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 4769 1552 391
result:
ok correct!
Test #47:
score: 0
Accepted
time: 1ms
memory: 3900kb
input:
6851 1620 3589 1643 13724
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 2 3 1620 3589 1642
result:
ok correct!
Test #48:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
8588 1136 6652 800 8589
output:
1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1136 6652 800
result:
ok correct!
Extra Test:
score: 0
Extra Test Passed