結果

問題 No.814 ジジ抜き
コンテスト
ユーザー WutongDeath
提出日時 2026-01-23 03:03:46
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 54 ms / 3,000 ms
+ 386µs
コード長 567 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 283 ms
コンパイル使用メモリ 73,216 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-20 13:50:09
合計ジャッジ時間 4,146 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>

using namespace std;

typedef long long LL;

int n, d;
LL k, l, ans, ll;

int main() {
    // freopen("card.in", "r", stdin);
    // freopen("card.out", "w", stdout);

    scanf("%d", &n);
    ans = 0LL;
    for (int i = 1; i <= n; ++i) {
        scanf("%lld%lld%d", &k, &l, &d);
        ll = l >> d;
        while (k > 0 && ll % 4) {
            ans ^= l;
            l += 1 << d;
            ++ll;
            --k;
        }
        while (k % 4) {
            ans ^= l + (--k << d);
        }
    }
    printf("%lld\n", ans);

    return 0;
}
0