QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#301352 | #6371. Half is Good | SolitaryDream# | WA | 1ms | 3580kb | C++17 | 1.1kb | 2024-01-09 18:18:41 | 2024-01-09 18:18:42 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e7 + 10;
typedef pair<long long, int> pui;
unsigned s;
unsigned getNext() {
s = s ^ (s << 13);
s = s ^ (s >> 17);
s = s ^ (s << 5);
return s;
}
int n, m;
int fa[N];
int px[N], py[N];
long long pz[N];
long long ans[N];
pui val[N];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> s;
for (int i = 0; i <= n; ++i) val[i] = pui(1ll << 62 | 10, m);
for (int i = 0; i < m; ++i) {
px[i] = getNext() % n;
py[i] = getNext() % n;
pz[i] = getNext() / 4;
pz[i] = pz[i] * getNext();
if (px[i] == py[i]) continue;
val[px[i]] = min(val[px[i]], pui(pz[i], i));
val[py[i]] = min(val[py[i]], pui(pz[i], i));
}
for (int i = 0; i < n; ++i) {
int k = val[i].second;
if (k == m) continue;
// cout << i << ' ' << val[i].second << endl;
ans[k / 32] |= 1ull << (k & 31);
}
for (int i = 0; i <= (n - 1) / 32; ++i) cout << ans[i] << ' ';
cout << endl;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3516kb
input:
4 7 47
output:
72
result:
ok you found 2 edges (out of 2 edges)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
1 1 956091059
output:
0
result:
ok you found 0 edges (out of 0 edges)
Test #3:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
1 10 675265052
output:
0
result:
ok you found 0 edges (out of 0 edges)
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3580kb
input:
1 100 649558818
output:
0
result:
wrong output format Unexpected end of file - int64 expected