結果

問題 No.814 ジジ抜き
ユーザー merom686merom686
提出日時 2019-04-12 22:36:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 96 ms / 3,000 ms
コード長 654 bytes
コンパイル時間 759 ms
コンパイル使用メモリ 72,676 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-12 22:12:34
合計ジャッジ時間 4,451 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 3 ms
4,352 KB
testcase_04 AC 92 ms
4,348 KB
testcase_05 AC 91 ms
4,348 KB
testcase_06 AC 96 ms
4,348 KB
testcase_07 AC 50 ms
4,348 KB
testcase_08 AC 93 ms
4,348 KB
testcase_09 AC 70 ms
4,348 KB
testcase_10 AC 93 ms
4,352 KB
testcase_11 AC 94 ms
4,348 KB
testcase_12 AC 48 ms
4,352 KB
testcase_13 AC 49 ms
4,352 KB
testcase_14 AC 72 ms
4,352 KB
testcase_15 AC 38 ms
4,352 KB
testcase_16 AC 38 ms
4,348 KB
testcase_17 AC 76 ms
4,352 KB
testcase_18 AC 66 ms
4,348 KB
testcase_19 AC 94 ms
4,348 KB
testcase_20 AC 48 ms
4,348 KB
testcase_21 AC 55 ms
4,348 KB
testcase_22 AC 79 ms
4,348 KB
testcase_23 AC 41 ms
4,352 KB
testcase_24 AC 71 ms
4,348 KB
testcase_25 AC 57 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    ll r = 0;
    for (int i = 0; i < n; i++) {
        ll k, l, d;
        cin >> k >> l >> d;
        d = 1LL << d;

        if (l & d) {
            r ^= l;
            k--;
            l += d;
        }
        if (k % 2) {
            r ^= l + (k - 1) * d;
            k--;
        }
        if (k / 2 % 2) {
            r ^= d;
        }
    }

    cout << r << endl;

    return 0;
}
0