QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#301352#6371. Half is GoodSolitaryDream#WA 1ms3580kbC++171.1kb2024-01-09 18:18:412024-01-09 18:18:42

Judging History

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

  • [2024-01-09 18:18:42]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3580kb
  • [2024-01-09 18:18:41]
  • 提交

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