結果

問題 No.670 log は定数
ユーザー %20
提出日時 2018-03-24 00:08:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 401 bytes
コンパイル時間 2,258 ms
コンパイル使用メモリ 194,656 KB
最終ジャッジ日時 2025-01-05 09:31:44
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:12:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   12 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull seed;
int next(){
	seed^=seed<<13;
	seed^=seed>>7;
	seed^=seed<<17;
	return seed>>33;
}
int a[200000];
main(){
	int N,Q;
	cin>>N>>Q>>seed;
	for(int i=0;i<10000;++i){
		next();
	}
	for(int i=0;i<N;++i){
		a[i]=next();
	}
	sort(a,a+N);
	ull z=0;
	for(ull i=0;i<Q;++i){
		z^=(lower_bound(a,a+N,next())-a)*i;
	}
	cout<<z;
}
0