結果

問題 No.670 log は定数
コンテスト
ユーザー 👑 tails
提出日時 2018-03-23 23:31:10
言語 cLay
(20250308-1 + boost 1.89.0)
コンパイル:
clayc _filename_
実行:
./a.out
結果
AC  
実行時間 384 ms / 4,000 ms
コード長 416 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,865 ms
コンパイル使用メモリ 192,284 KB
実行使用メモリ 20,736 KB
最終ジャッジ日時 2026-03-26 21:47:43
合計ジャッジ時間 6,402 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

ull seed;
int next() {
	seed = seed ^ (seed << 13);
	seed = seed ^ (seed >> 7);
	seed = seed ^ (seed << 17);
	return (seed >> 33);
}

int n,q,s,a[2d5],b[1<<22],*p,x,j;
ll r;
{
	rd(n,q,s);seed=s;
	rep(1d4)next();
	a[0..n-1]=next();
	sort(a,a+n);

	rep(i,n){
		while(a[i]>>10>=j+1){
			b[++j]=i;
		}
	}
	b[j+1..(1<<22)-1]=n;

	rep(i,q){
		x=next();
		r^=i*(ll)(lower_bound(a+b[x>>10],a+b[(x>>10)+1],x)-a);
	}
	wt(r);
}
0