結果

問題 No.814 ジジ抜き
ユーザー Lepton_sLepton_s
提出日時 2018-02-20 17:38:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 86 ms / 3,000 ms
コード長 618 bytes
コンパイル時間 656 ms
コンパイル使用メモリ 68,728 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-27 10:20:09
合計ジャッジ時間 7,342 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 81 ms
4,380 KB
testcase_05 AC 83 ms
4,384 KB
testcase_06 AC 86 ms
4,380 KB
testcase_07 AC 45 ms
4,380 KB
testcase_08 AC 84 ms
4,384 KB
testcase_09 AC 65 ms
4,380 KB
testcase_10 AC 86 ms
4,380 KB
testcase_11 AC 83 ms
4,380 KB
testcase_12 AC 43 ms
4,380 KB
testcase_13 AC 43 ms
4,380 KB
testcase_14 AC 66 ms
4,376 KB
testcase_15 AC 35 ms
4,380 KB
testcase_16 AC 34 ms
4,380 KB
testcase_17 AC 69 ms
4,380 KB
testcase_18 AC 59 ms
4,376 KB
testcase_19 AC 85 ms
4,380 KB
testcase_20 AC 46 ms
4,380 KB
testcase_21 AC 52 ms
4,376 KB
testcase_22 AC 76 ms
4,376 KB
testcase_23 AC 39 ms
4,376 KB
testcase_24 AC 64 ms
4,380 KB
testcase_25 AC 52 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// validator
#include <cstdio>
#include <iostream>
#include <cassert>
using namespace std;
typedef long long ll;
#define REP(i,a,b) for(ll (i)=a;(i)<(ll)(b);++(i))
#define rep(i,n) REP(i,0,n)

int main(){
	ll N;
	scanf("%lld", &N);
	assert(1<=N&&N<=300000);
	ll x = 0;
	rep(i, N){
		ll K, L, D;
		scanf("%lld%lld%lld", &K, &L, &D);
		assert(K>=1);
		assert(0<=D&&D<=59);
		assert(0<=L);
		assert((ll)(L+(((__int128_t)(K-1))<<D))<=(ll)1e18);
		ll L2 = L>>D;
		while(K>0 && L2%4!=0){
			x ^= L;
			L += 1LL<<D;
			L2++;
			K--;
		}
		while(K%4!=0){
			x ^= L+((K-1)<<D);
			K--;
		}
	}
	printf("%lld\n", x);
	return 0;
}
0