QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#509952 | #9156. 百万富翁 | Littlelu | 0 | 92ms | 58600kb | C++14 | 762b | 2024-08-08 20:07:59 | 2024-08-08 20:07:59 |
Judging History
answer
#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int t0(){
int n=1000,m=0;
vector<int> a,b,c,gr[1005],in(n+1),ord;
queue<int> que;
for(int i=1;i<=n;++i) for(int j=i+1;j<=n;++j) a.push_back(i),b.push_back(j),++m;
c=ask(a,b);
for(int i=0;i<m;++i){
if(c[i]==a[i]) gr[b[i]].push_back(a[i]),in[a[i]]++;
else gr[a[i]].push_back(b[i]),in[b[i]]++;
}
for(int i=1;i<=n;++i) if(in[i]==0) que.push(i);
while(!que.empty()){
int u=que.front();que.pop();
ord.push_back(u);
for(int v:gr[u]){
in[v]--;
if(in[v]==0) que.push(v);
}
}
return *(ord.end()--);
}
int richest(int n,int t,int s){
if(n==1000) return t0();
}
详细
Pretests
Pretest #1:
score: 0
Wrong Answer
time: 8ms
memory: 16000kb
input:
1000 1 499500 957319859
output:
Index out of bounds 9775460264716263939 0.000000 6906350380861515327
result:
points 0.0 Index out of bounds
Pretest #2:
score: 0
Wrong Answer
time: 82ms
memory: 58496kb
input:
1000000 20 2000000 29091473
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer
Final Tests
Test #1:
score: 0
Wrong Answer
time: 3ms
memory: 15944kb
input:
1000 1 499500 957319857
output:
Index out of bounds 9775460264716263939 0.000000 6906350380861515327
result:
points 0.0 Index out of bounds
Test #2:
score: 0
Wrong Answer
time: 92ms
memory: 58600kb
input:
1000000 20 2000000 29091471
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer