結果

問題 No.814 ジジ抜き
コンテスト
ユーザー 梧桐
提出日時 2026-01-23 03:03:46
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 122 ms / 3,000 ms
コード長 567 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 515 ms
コンパイル使用メモリ 74,896 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-01-23 03:03:53
合計ジャッジ時間 6,087 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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