QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#560915 | #9156. 百万富翁 | RDFZchenyy | 15 | 649ms | 48636kb | C++14 | 884b | 2024-09-12 18:52:29 | 2024-09-12 18:52:30 |
Judging History
answer
#include "richest.h"
#include<bits/stdc++.h>
// std::vector<int> ask(std::vector<int> a,std::vector<int> b);
std::vector<int> p,q;
int a[1005][1005];
int richest(int n,int t,int s){
if(n==1000){
p.clear(); q.clear();
memset(a,0,sizeof(a));
for(int i=0;i<=n-1;i++){
for(int j=i+1;j<=n-1;j++){
p.push_back(i); q.push_back(j);
}
}
p=ask(p,q);
int cnt=0;
for(int i=0;i<=n-1;i++){
for(int j=i+1;j<=n-1;j++){
a[p[cnt]][i+j-p[cnt]]=1;
cnt++;
}
}
for(int i=0;i<=n-1;i++){
int cnt=0;
for(int j=0;j<=n-1;j++){
cnt+=a[i][j];
}
if(cnt==n-1){
return i;
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 649ms
memory: 27984kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Wrong Answer
time: 12ms
memory: 48224kb
input:
1000000 20 2000000 29091473
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer
Final Tests
Test #1:
score: 15
Accepted
time: 637ms
memory: 26252kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 0
Wrong Answer
time: 12ms
memory: 48636kb
input:
1000000 20 2000000 29091471
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer