QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#499362 | #9156. 百万富翁 | sunkaihuan# | 0 | 211ms | 84484kb | C++14 | 996b | 2024-07-31 13:21:08 | 2024-07-31 13:21:09 |
Judging History
answer
#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
int ix[1000005],nw[1000005],cl,cr;
vector<int> qla,qlb,an;bool v[10005];
int richest(int N, int T, int S) {
for(int i=1;i<=10000;i++)v[i]=0;
cl=N;for(int i=1;i<=N;i++)ix[i]=i-1;
for(int i=1;i<=8;i++){
if(cl==1)return ix[cl];
qla.clear();qlb.clear();
for(int j=1;j<cl;j++)
qla.push_back(ix[j]),qlb.push_back(ix[j+1]);
an=ask(qla,qlb);cr=0;
for(int j=1;j<=cl;j++){
if(j==1&&an[0]==ix[1]||j==cl&&an[cl-2]==ix[cl])nw[++cr]=ix[j];
if(1<j&&j<cl&&an[j-2]==ix[j]&&an[j-1]==ix[j])nw[++cr]=ix[j];
}for(int j=1;j<=cr;j++)ix[j]=nw[j];cl=cr;
//for(int j=1;j<=cl;j++)cout<<ix[j]<<" ";cout<<"\n";
}if(cl==1)return ix[cl];
qla.clear();qlb.clear();
for(int i=1;i<=cl;i++)
for(int j=i+1;j<=cl;j++)
qla.push_back(ix[i]),qlb.push_back(ix[j]);
an=ask(qla,qlb);cr=0;
for(int i=1;i<=cl;i++)
for(int j=i+1;j<=cl;j++)
v[i+j-an[cr++]]=1;
for(int i=0;i<cl;i++)if(!v[i])return ix[i];
}
详细
Pretests
Pretest #1:
score: 0
Wrong Answer
time: 2ms
memory: 12068kb
input:
1000 1 499500 957319859
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Pretest #2:
score: 0
Wrong Answer
time: 211ms
memory: 84484kb
input:
1000000 20 2000000 29091473
output:
Grader internal error 2 3765510641152510719 0.000000 6906350380861515327
result:
points 0.0 Grader internal error 2
Final Tests
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 12184kb
input:
1000 1 499500 957319857
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Test #2:
score: 0
Wrong Answer
time: 204ms
memory: 84364kb
input:
1000000 20 2000000 29091471
output:
Grader internal error 2 3765510641152510719 0.000000 6906350380861515327
result:
points 0.0 Grader internal error 2