QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#301350#6371. Half is GoodSolitaryDream#WA 2ms11764kbC++171.1kb2024-01-09 18:17:172024-01-09 18:17:17

Judging History

你现在查看的是最新测评结果

  • [2024-01-09 18:17:17]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:11764kb
  • [2024-01-09 18:17:17]
  • 提交

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 << 61 | 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: 2ms
memory: 11764kb

input:

4 7 47

output:

72 

result:

ok you found 2 edges (out of 2 edges)

Test #2:

score: 0
Accepted
time: 2ms
memory: 9792kb

input:

1 1 956091059

output:

0 

result:

ok you found 0 edges (out of 0 edges)

Test #3:

score: 0
Accepted
time: 0ms
memory: 9768kb

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: 9744kb

input:

1 100 649558818

output:

0 

result:

wrong output format Unexpected end of file - int64 expected