結果
| 問題 |
No.814 ジジ抜き
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-12 22:14:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 315 ms / 3,000 ms |
| コード長 | 505 bytes |
| コンパイル時間 | 1,880 ms |
| コンパイル使用メモリ | 167,388 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 19:29:09 |
| 合計ジャッジ時間 | 10,954 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 |
ソースコード
#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;
}