結果

問題 No.814 ジジ抜き
ユーザー pekempeypekempey
提出日時 2019-04-14 17:30:21
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 306 ms / 3,000 ms
コード長 552 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 74,820 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 09:46:01
合計ジャッジ時間 7,946 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 4 ms
4,348 KB
testcase_04 AC 301 ms
4,348 KB
testcase_05 AC 302 ms
4,348 KB
testcase_06 AC 306 ms
4,348 KB
testcase_07 AC 154 ms
4,348 KB
testcase_08 AC 296 ms
4,348 KB
testcase_09 AC 221 ms
4,348 KB
testcase_10 AC 292 ms
4,348 KB
testcase_11 AC 299 ms
4,348 KB
testcase_12 AC 153 ms
4,348 KB
testcase_13 AC 154 ms
4,348 KB
testcase_14 AC 232 ms
4,348 KB
testcase_15 AC 119 ms
4,348 KB
testcase_16 AC 118 ms
4,348 KB
testcase_17 AC 242 ms
4,348 KB
testcase_18 AC 207 ms
4,348 KB
testcase_19 AC 293 ms
4,348 KB
testcase_20 AC 154 ms
4,348 KB
testcase_21 AC 174 ms
4,348 KB
testcase_22 AC 248 ms
4,348 KB
testcase_23 AC 126 ms
4,348 KB
testcase_24 AC 219 ms
4,348 KB
testcase_25 AC 178 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <cstring>

using namespace std;

long long f(long long n) {
  n++;
  long long res = 0;
  for (long long k = n / 4 * 4; k < n; k++) {
    res ^= k;
  }
  return res;
}

int main() {
  int N;
  cin >> N;
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    long long K, L, D;
    cin >> K >> L >> D;
    if (K % 2 == 1) {
      ans ^= L & (1LL << D) - 1;
    }
    L >>= D;
    ans ^= (f(L + (K - 1)) ^ f(L - 1)) << D;
  }
  cout << ans << endl;
}
0