結果
問題 | No.670 log は定数 |
ユーザー |
|
提出日時 | 2018-03-26 20:15:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3,109 ms / 4,000 ms |
コード長 | 868 bytes |
コンパイル時間 | 1,696 ms |
コンパイル使用メモリ | 160,728 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 06:55:53 |
合計ジャッジ時間 | 34,212 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;using ull = unsigned long long;ull seed;int next() {seed = seed ^ (seed << 13);seed = seed ^ (seed >> 7);seed = seed ^ (seed << 17);return (seed >> 33);}int a[200010];int main() {int n, q;cin >> n >> q >> seed;for (int i = 0; i < 10000; i++) next();for (int i = 1; i <= n; i++) a[i] = next();sort(a + 1, a + n + 1);ll sm = 0;ll del = 0;for (int i = 0; i < q; i++) {int x = next();int y = (1ll * x * n) >> 31;while (y > 10 && a[y-10] >= x) y-=10;while (y + 10 < n && a[y+10] < x) y+=10;while (y > 0 && a[y] >= x) y--;while (y < n && a[y+1] < x) y++;sm ^= ll(y) * i;}cout << sm << endl;//cout << del << ' ' << q << ' ' << del / q << endl;return 0;}