結果

問題 No.670 log は定数
ユーザー cielciel
提出日時 2018-04-17 23:23:18
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 578 bytes
コンパイル時間 541 ms
コンパイル使用メモリ 85,100 KB
実行使用メモリ 11,428 KB
最終ジャッジ日時 2023-08-20 10:39:45
合計ジャッジ時間 22,862 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 3,956 ms
4,384 KB
testcase_02 AC 3,996 ms
4,380 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")

#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

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

int main(){
	int n,q;
	scanf("%d%d%llu",&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());
	long long ret=0;
	for(int i=0;i<q;i++){
		int x=next();
		ret^=(long long)i*distance(a.begin(),lower_bound(a.begin(),a.end(),x));
	}
	printf("%lld\n",ret);
}
0