結果

問題 No.814 ジジ抜き
ユーザー Lepton_s
提出日時 2018-01-23 04:02:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 94 ms / 3,000 ms
コード長 430 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 63,232 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 03:00:20
合計ジャッジ時間 5,593 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <iostream>
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);
	ll x = 0;
	rep(i, N){
		ll K, L, D;
		scanf("%lld%lld%lld", &K, &L, &D);
		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