結果

問題 No.670 log は定数
コンテスト
ユーザー ldsyb
提出日時 2018-03-24 12:49:15
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 541 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,593 ms
コンパイル使用メモリ 190,236 KB
実行使用メモリ 11,812 KB
最終ジャッジ日時 2026-03-11 07:21:21
合計ジャッジ時間 56,664 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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