結果

問題 No.670 log は定数
ユーザー mamekinmamekin
提出日時 2018-03-26 08:48:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 1,313 bytes
コンパイル時間 1,259 ms
コンパイル使用メモリ 108,348 KB
実行使用メモリ 597,660 KB
最終ジャッジ日時 2023-09-07 12:34:21
合計ジャッジ時間 37,960 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

unsigned long long seed;
int next() {
    seed ^= seed << 13;
    seed ^= seed >> 7;
    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(a.begin(), a.end());

    vector<int> cnt(INT_MAX / 100 + 2, 0);
    vector<vector<int> > v(INT_MAX / 100 + 1);
    for(int i=0; i<n; ++i){
        ++ cnt[a[i]/100+1];
        v[a[i]/100].push_back(a[i]);
    }
    for(int i=0; i<=INT_MAX/100; ++i)
        cnt[i+1] += cnt[i];

    long long ans = 0;
    for(int i=0; i<q; ++i){
        int x = next();
        int y = cnt[x/100];
        y += lower_bound(v[x/100].begin(), v[x/100].end(), x) - v[x/100].begin();
        ans ^= y * (long long)i;
    }
    cout << ans << endl;

    return 0;
}
0