結果

問題 No.670 log は定数
ユーザー yosupotyosupot
提出日時 2017-09-10 03:54:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,093 bytes
コンパイル時間 1,245 ms
コンパイル使用メモリ 113,348 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 03:07:45
合計ジャッジ時間 38,054 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <numeric>
#include <random>
#include <vector>
#include <array>
#include <bitset>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;


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

int main() {
    int n; uint q;
    cin >> n >> q >> seed;
    for (int i = 0; i < 10000; i++) next();
    V<int> a(n);
    for (int i = 0; i < n; i++) a[i] = next();
    sort(begin(a), end(a));
    ll sm = 0;
    for (uint i = 0; i < q/2; i++) {
        int x = next();
        sm ^= (lower_bound(begin(a), end(a), x) - begin(a)) * i;
    }
    cout << sm << endl;
    return 0;
}
0