QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#502037 | #9156. 百万富翁 | fryan# | 15 | 641ms | 24368kb | C++14 | 1.2kb | 2024-08-03 00:39:29 | 2024-08-03 00:39:31 |
Judging History
answer
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include "richest.h"
using namespace std;
#define sz(x) (int) (x).size()
#define i64 int64_t
#define all(x) (x).begin(), (x).end()
vector<int> a,b;
vector<int> c;
int subtask_1(int N) {
a.resize(0);
b.resize(0);
for (int i=0; i<N; i++) {
for (int j=i+1; j<N; j++) {
a.push_back(i);
b.push_back(j);
}
}
assert(sz(a)<=499500);
c = ask(a,b);
set<int> ok;
for (int i=0; i<N; i++) {
ok.insert(i);
}
for (int i=0; i<sz(c); i++) {
if (a[i]==c[i]) {
if (ok.count(b[i])) ok.erase(b[i]);
} else {
if (ok.count(a[i])) ok.erase(a[i]);
}
}
assert(sz(ok)==1);
return *(ok.begin());
}
int richest(int N, int T=1, int S=1) {
assert(T==1);
return subtask_1(N);
}
详细
Pretests
Pretest #1:
score: 15
Accepted
time: 641ms
memory: 24368kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Runtime Error
input:
1000000 20 2000000 29091473
output:
Unauthorized output
result:
Final Tests
Test #1:
score: 15
Accepted
time: 635ms
memory: 22388kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 0
Runtime Error
input:
1000000 20 2000000 29091471
output:
Unauthorized output