QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#537905 | #9156. 百万富翁 | Nevll# | 14.00001 | 2220ms | 99292kb | C++14 | 1.1kb | 2024-08-30 19:37:24 | 2024-08-30 19:37:25 |
Judging History
answer
#include "richest.h"
# include <bits/stdc++.h>
# define ll long long
# define fi first
# define se second
# define pii pair<int, int>
using namespace std;
int richest(int N, int T, int S) {
vector<int> nw;
for(int i=0;i<N;i++) nw.push_back(i);
while(nw.size() > 1) {
vector<int> as1, as2;
as1.clear();
as2.clear();
for(int i=0;i+1<nw.size();i+=2) {
as1.push_back(nw[i]);
as2.push_back(nw[i + 1]);
}
int ls = -1;
if(nw.size()%2 == 1) {
ls = nw.back();
int x = as1.back(), y = as2.back();
as1.push_back(x);
as2.push_back(ls);
as1.push_back(ls);
as2.push_back(y);
}
nw = ask(as1, as2);
if(ls != -1) {
int u = nw.back();
nw.pop_back();
int v = nw.back();
nw.pop_back();
if(u == ls && v == ls) {
nw.pop_back();
nw.push_back(ls);
}
}
}
return nw[0];
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 0
Wrong Answer
time: 1ms
memory: 8080kb
input:
1000 1 499500 957319859
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Pretest #2:
score: 14
Acceptable Answer
time: 2220ms
memory: 83756kb
input:
1000000 20 2000000 29091473
output:
Partially correct Case 2, 14 / 85, maxt = 19, maxs = 1000005 13306494782194859851 0.164706 11889891265969853183
result:
points 0.164706 Partially correct Case 2, 14 / 85, maxt = 19, maxs = 1000005
Final Tests
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 7964kb
input:
1000 1 499500 957319857
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Test #2:
score: 14
Acceptable Answer
time: 2214ms
memory: 99292kb
input:
1000000 20 2000000 29091471
output:
Partially correct Case 2, 14 / 85, maxt = 19, maxs = 1000005 13306494782194859851 0.164706 11889891265969853183
result:
points 0.164706 Partially correct Case 2, 14 / 85, maxt = 19, maxs = 1000005