結果

問題 No.670 log は定数
ユーザー %20
提出日時 2018-03-23 23:43:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 436 bytes
コンパイル時間 3,597 ms
コンパイル使用メモリ 196,712 KB
最終ジャッジ日時 2025-01-05 09:25:52
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:11:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   11 | 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;
}
main(){
	int N,Q;
	cin>>N>>Q>>seed;
	for(int i=0;i<10000;++i){
		next();
	}
	vector<int>a(N);
	for(int i=0;i<N;++i){
		a[i]=next();
	}
	sort(a.begin(),a.end());
	ull z=0;
	for(ull i=0;i<Q;++i){
		z^=(lower_bound(a.begin(),a.end(),next())-a.begin())*i;
	}
	cout<<z;
}
0