QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#412027 | #8356. 猜猜看 | zhouhuanyi | 100 ✓ | 33ms | 28812kb | C++14 | 1.0kb | 2024-05-15 23:19:00 | 2024-05-15 23:19:00 |
Judging History
answer
#include "guess.h"
#include<iostream>
#include<cstdio>
#include<ctime>
#define N 500000
using namespace std;
int s[4],a,b,c,d,L,R,d1,d2;
vector<int> solve(int n,int m)
{
vector<int>ans(n);
s[0]=query2(1,2,3),s[1]=query2(0,2,3),s[2]=query2(0,1,3),s[3]=query2(0,1,2);
if (s[0]==s[1]&&s[2]==s[3])
{
if (s[0]>s[2]) a=0,b=1,c=2,d=3;
else a=2,b=3,c=0,d=1;
}
if (s[0]==s[2]&&s[1]==s[3])
{
if (s[0]>s[1]) a=0,b=2,c=1,d=3;
else a=1,b=3,c=0,d=2;
}
if (s[0]==s[3]&&s[1]==s[2])
{
if (s[0]>s[1]) a=0,b=3,c=1,d=2;
else a=1,b=2,c=0,d=3;
}
L=query2(a,b,c),R=query2(b,c,d);
for (int i=4;i<n;++i)
{
d1=query2(a,c,i),d2=query2(b,d,i);
if (d1<=L)
{
if (d1<d2) ans[b]=L,b=i,L=d1;
else ans[a]=L,a=i,L=d2;
}
else if (d1>=R)
{
if (d1>d2) ans[d]=R,d=i,R=d1;
else ans[c]=R,c=i,R=d2;
}
else ans[i]=d1;
}
if (!query1(a,b)) swap(a,b);
if (!query1(c,d)) swap(c,d);
ans[a]=1,ans[b]=2,ans[c]=n-1,ans[d]=n;
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 21
Accepted
Test #1:
score: 21
Accepted
time: 0ms
memory: 3904kb
input:
97779581 100 1000000 0
output:
Accepted cnt = 198
result:
ok Accepted
Test #2:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
282068802 100 1000000 0
output:
Accepted cnt = 198
result:
ok Accepted
Test #3:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
1105812259 100 1000000 0
output:
Accepted cnt = 198
result:
ok Accepted
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
957173936 100 1000000 1 7
output:
Accepted cnt = 198
result:
ok Accepted
Test #5:
score: 0
Accepted
time: 0ms
memory: 4076kb
input:
1747572941 100 1000000 1 28
output:
Accepted cnt = 198
result:
ok Accepted
Test #6:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
1406281899 100 1000000 1 13
output:
Accepted cnt = 198
result:
ok Accepted
Test #7:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
24466719 100 1000000 2 0
output:
Accepted cnt = 198
result:
ok Accepted
Test #8:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
789989950 100 1000000 2 1
output:
Accepted cnt = 198
result:
ok Accepted
Subtask #2:
score: 22
Accepted
Dependency #1:
100%
Accepted
Test #9:
score: 22
Accepted
time: 0ms
memory: 3816kb
input:
1869471894 1000 1000000 0
output:
Accepted cnt = 1998
result:
ok Accepted
Test #10:
score: 0
Accepted
time: 0ms
memory: 4140kb
input:
311690097 1000 1000000 0
output:
Accepted cnt = 1998
result:
ok Accepted
Test #11:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
467028547 1000 1000000 0
output:
Accepted cnt = 1998
result:
ok Accepted
Test #12:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
493627059 1000 1000000 1 381
output:
Accepted cnt = 1998
result:
ok Accepted
Test #13:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1770936389 1000 1000000 1 801
output:
Accepted cnt = 1998
result:
ok Accepted
Test #14:
score: 0
Accepted
time: 0ms
memory: 4140kb
input:
1159908535 1000 1000000 1 207
output:
Accepted cnt = 1998
result:
ok Accepted
Test #15:
score: 0
Accepted
time: 0ms
memory: 4204kb
input:
1078555386 1000 1000000 2 0
output:
Accepted cnt = 1998
result:
ok Accepted
Test #16:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
2086762479 1000 1000000 2 1
output:
Accepted cnt = 1998
result:
ok Accepted
Subtask #3:
score: 57
Accepted
Dependency #2:
100%
Accepted
Test #17:
score: 57
Accepted
time: 6ms
memory: 5512kb
input:
913204624 300000 900000 0
output:
Accepted cnt = 599998
result:
ok Accepted
Test #18:
score: 0
Accepted
time: 3ms
memory: 5592kb
input:
442811227 300000 900000 0
output:
Accepted cnt = 599998
result:
ok Accepted
Test #19:
score: 0
Accepted
time: 0ms
memory: 5724kb
input:
1820509136 300000 900000 0
output:
Accepted cnt = 599998
result:
ok Accepted
Test #20:
score: 0
Accepted
time: 9ms
memory: 7088kb
input:
1010948745 300000 900000 1 219487
output:
Accepted cnt = 599998
result:
ok Accepted
Test #21:
score: 0
Accepted
time: 8ms
memory: 7196kb
input:
2050517583 300000 900000 1 22965
output:
Accepted cnt = 599998
result:
ok Accepted
Test #22:
score: 0
Accepted
time: 8ms
memory: 7256kb
input:
301966999 300000 900000 1 8750
output:
Accepted cnt = 599998
result:
ok Accepted
Test #23:
score: 0
Accepted
time: 23ms
memory: 25304kb
input:
738585868 300000 900000 2 0
output:
Accepted cnt = 599998
result:
ok Accepted
Test #24:
score: 0
Accepted
time: 30ms
memory: 25384kb
input:
1706858262 300000 900000 2 1
output:
Accepted cnt = 599998
result:
ok Accepted
Test #25:
score: 0
Accepted
time: 11ms
memory: 7384kb
input:
899707168 500000 1000000 0
output:
Accepted cnt = 999998
result:
ok Accepted
Test #26:
score: 0
Accepted
time: 11ms
memory: 7312kb
input:
1494760101 500000 1000000 0
output:
Accepted cnt = 999998
result:
ok Accepted
Test #27:
score: 0
Accepted
time: 11ms
memory: 7376kb
input:
972556126 500000 1000000 0
output:
Accepted cnt = 999998
result:
ok Accepted
Test #28:
score: 0
Accepted
time: 14ms
memory: 9568kb
input:
1162933628 500000 1000000 1 282897
output:
Accepted cnt = 999998
result:
ok Accepted
Test #29:
score: 0
Accepted
time: 12ms
memory: 9564kb
input:
2060580761 500000 1000000 1 165975
output:
Accepted cnt = 999998
result:
ok Accepted
Test #30:
score: 0
Accepted
time: 15ms
memory: 9540kb
input:
1700006891 500000 1000000 1 371272
output:
Accepted cnt = 999998
result:
ok Accepted
Test #31:
score: 0
Accepted
time: 31ms
memory: 28812kb
input:
208653150 500000 1000000 2 0
output:
Accepted cnt = 999998
result:
ok Accepted
Test #32:
score: 0
Accepted
time: 33ms
memory: 28428kb
input:
310032697 500000 1000000 2 1
output:
Accepted cnt = 999998
result:
ok Accepted