結果

問題 No.670 log は定数
ユーザー ldsybldsyb
提出日時 2018-03-24 12:49:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 541 bytes
コンパイル時間 1,697 ms
コンパイル使用メモリ 169,196 KB
実行使用メモリ 12,744 KB
最終ジャッジ日時 2023-09-07 08:25:05
合計ジャッジ時間 12,255 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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, q;
	uint64_t seed;
	auto next = [&]{
		seed ^= seed << 13;
		seed ^= seed >> 7;
		seed ^= seed << 17;
		return seed >> 33;
	};
	cin >> n >> q >> seed;
	for (int i = 0; i < 10000; i++) {
		next();
	}
	vector<int> a(n);
	for (auto &i : a) {
		i = next();
	}
	sort(a.begin(), a.end());
	int64_t ans = 0;
	for (int64_t i = 0; i < q; i++) {
		int64_t count = distance(a.begin(), lower_bound(a.begin(), a.end(), next()));
		ans ^= count * i;
	}
	cout << ans << endl;
	return 0;
}
0