結果

問題 No.670 log は定数
ユーザー tko919tko919
提出日時 2019-04-08 17:42:02
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,030 bytes
コンパイル時間 736 ms
コンパイル使用メモリ 81,400 KB
実行使用メモリ 12,904 KB
最終ジャッジ日時 2023-09-14 15:42:58
合計ジャッジ時間 11,324 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <math.h>
#include <complex>
#include <cassert>
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define case(i) cout<<"Case #"<<i<<": ";
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> p;
typedef complex<double> com;
const int mod = 1e9 + 7;
const int MOD = 998244353;
const ll INF = 1e18;

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;
	cin >> n >> q >> seed;
	rep(i, 0, 10000) next();
	vector<int> a(n);
	rep(i, 0, n) a[i] = next();
	sort(a.begin(), a.end());
	ll sum = 0;
	rep(i, 0, q) {
		int x = next();
		int cnt = lower_bound(a.begin(), a.end(), x)-a.begin();
		sum ^= (ll)cnt * i;
	}
	cout << sum << endl;
	return 0;
}
0