結果
問題 | No.670 log は定数 |
ユーザー | TsReaper |
提出日時 | 2018-03-26 20:10:26 |
言語 | C++11 (gcc 11.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 662 bytes |
コンパイル時間 | 303 ms |
コンパイル使用メモリ | 41,952 KB |
実行使用メモリ | 12,460 KB |
最終ジャッジ日時 | 2023-09-07 12:49:14 |
合計ジャッジ時間 | 10,815 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | TLE | - |
testcase_01 | -- | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
ソースコード
#include <cstdio> #include <algorithm> using namespace std; int n,q,A[200010]; unsigned long long seed; long long ans; int next() { seed = seed ^ (seed << 13); seed = seed ^ (seed >> 7); seed = seed ^ (seed << 17); return (seed >> 33); } int main() { int i,x,y,z; scanf("%d%d%llu",&n,&q,&seed); for(i=0;i<10000;i++) next(); for(i=1;i<=n;i++) A[i] = next(); sort(A+1,A+n+1); for(i=0;i<q;i++) { x = next(); y = 1LL*x*n/A[n]; if(y > n) y = n; while(y > 0 && A[y] >= x) y--; while(y < n && A[y+1] < x) y++; ans ^= 1LL*i*y; } printf("%lld",ans); return 0; }