結果

問題 No.814 ジジ抜き
ユーザー betrue12betrue12
提出日時 2019-04-12 22:14:40
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 356 ms / 3,000 ms
コード長 505 bytes
コンパイル時間 1,718 ms
コンパイル使用メモリ 163,548 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 21:10:12
合計ジャッジ時間 8,555 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,356 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 4 ms
4,352 KB
testcase_04 AC 356 ms
4,348 KB
testcase_05 AC 278 ms
4,348 KB
testcase_06 AC 289 ms
4,348 KB
testcase_07 AC 145 ms
4,348 KB
testcase_08 AC 280 ms
4,348 KB
testcase_09 AC 207 ms
4,348 KB
testcase_10 AC 278 ms
4,348 KB
testcase_11 AC 280 ms
4,348 KB
testcase_12 AC 143 ms
4,348 KB
testcase_13 AC 144 ms
4,352 KB
testcase_14 AC 216 ms
4,348 KB
testcase_15 AC 111 ms
4,348 KB
testcase_16 AC 113 ms
4,348 KB
testcase_17 AC 229 ms
4,348 KB
testcase_18 AC 195 ms
4,348 KB
testcase_19 AC 275 ms
4,348 KB
testcase_20 AC 145 ms
4,348 KB
testcase_21 AC 163 ms
4,348 KB
testcase_22 AC 234 ms
4,348 KB
testcase_23 AC 119 ms
4,348 KB
testcase_24 AC 207 ms
4,348 KB
testcase_25 AC 172 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int64_t calc(int64_t K){
    int64_t d = 0;
    for(int64_t i=K/4*4; i<K; i++) d ^= i;
    return d;
}

int main(){
    int N;
    cin >> N;
    int64_t ans = 0;
    while(N--){
        int64_t K, L, D;
        cin >> K >> L >> D;
        int64_t B = 1LL << D;
        if(K%2) ans ^= L % B;
        int64_t offset = L / B;
        int64_t d = calc(K + offset) ^ calc(offset);
        d <<= D;
        ans ^= d;
    }
    cout << ans << endl;
    return 0;
}
0