結果
問題 |
No.670 log は定数
|
ユーザー |
![]() |
提出日時 | 2018-03-24 12:46:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 554 bytes |
コンパイル時間 | 1,686 ms |
コンパイル使用メモリ | 171,532 KB |
実行使用メモリ | 14,592 KB |
最終ジャッジ日時 | 2024-06-25 02:45:31 |
合計ジャッジ時間 | 12,129 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n, q; uint64_t seed; auto next = [&]{ seed ^= seed << 13; seed ^= seed >> 7; seed ^= seed << 17; return seed >> 33; }; cin >> n >> q >> seed; for (int i = 0; i < 10000; i++) { next(); } vector<int> a(n); for (auto &i : a) { i = next(); } sort(a.begin(), a.end()); int64_t ans = 0; for (int64_t i = 0; i < q; i++) { int x = next(); int64_t count = distance(a.begin(), lower_bound(a.begin(), a.end(), x)); ans ^= count * i; } cout << ans << endl; return 0; }