結果
| 問題 | No.670 log は定数 |
| コンテスト | |
| ユーザー |
どらら
|
| 提出日時 | 2018-03-23 23:18:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,141 bytes |
| 記録 | |
| コンパイル時間 | 1,778 ms |
| コンパイル使用メモリ | 177,552 KB |
| 実行使用メモリ | 17,984 KB |
| 最終ジャッジ日時 | 2024-06-24 22:51:07 |
| 合計ジャッジ時間 | 12,257 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;
ull 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;
for (int i = 0; i < 10000; i++) next();
vector<int> a(n);
for (int i = 0; i < n; i++) a[i] = next();
sort(ALLOF(a));
vector<pair<int,int>> query;
ll sm = 0;
for (int i = 0; i < q; i++) {
int x = next();
query.push_back(make_pair(x,i));
if(query.size() == 10000 || i == q-1){
sort(ALLOF(query));
int pos = 0;
rep(j,query.size()){
int x = query[j].first;
int id = query[j].second;
while(pos < a.size() && a[pos] < x) pos++;
//cout << x << " " << pos << endl;
sm ^= (ll)(pos) * id;
}
query.clear();
}
}
cout << sm << endl;
return 0;
}
どらら