結果

問題 No.814 ジジ抜き
ユーザー ahe100ahe100
提出日時 2019-04-13 03:07:37
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 281 ms / 3,000 ms
コード長 804 bytes
コンパイル時間 2,522 ms
コンパイル使用メモリ 165,720 KB
実行使用メモリ 10,560 KB
最終ジャッジ日時 2023-10-13 09:29:03
合計ジャッジ時間 8,204 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,408 KB
testcase_01 AC 3 ms
7,720 KB
testcase_02 AC 2 ms
7,512 KB
testcase_03 AC 5 ms
7,724 KB
testcase_04 AC 281 ms
10,324 KB
testcase_05 AC 275 ms
10,344 KB
testcase_06 AC 281 ms
10,408 KB
testcase_07 AC 146 ms
8,664 KB
testcase_08 AC 275 ms
10,292 KB
testcase_09 AC 212 ms
9,528 KB
testcase_10 AC 271 ms
10,396 KB
testcase_11 AC 269 ms
10,352 KB
testcase_12 AC 141 ms
8,572 KB
testcase_13 AC 148 ms
8,608 KB
testcase_14 AC 215 ms
9,488 KB
testcase_15 AC 118 ms
8,356 KB
testcase_16 AC 108 ms
8,328 KB
testcase_17 AC 222 ms
9,816 KB
testcase_18 AC 190 ms
9,132 KB
testcase_19 AC 266 ms
10,560 KB
testcase_20 AC 138 ms
8,560 KB
testcase_21 AC 157 ms
8,740 KB
testcase_22 AC 221 ms
9,740 KB
testcase_23 AC 113 ms
8,692 KB
testcase_24 AC 205 ms
9,340 KB
testcase_25 AC 162 ms
8,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;

/*
AC
全てのカードのxorはx
*/

ll n,k[300010],l[300010],d[300010],ans=0;

ll f(ll x){
	if(x%4==0)return x;
	if(x%4==1)return 1;
	if(x%4==2)return x+1;
	return 0;
}

void init(){
	cin>>n;
	rep(i,n)cin>>k[i]>>l[i]>>d[i];
}

int main(void){
	init();
	rep(i,n){
		ll ue = l[i]>>d[i];
		ans = ans ^ ((f(ue + k[i]-1) ^ f(ue-1))<<d[i]) ^ (k[i]%2?(ue<<d[i])^l[i]:0);
	}
	cout<<ans<<endl;
	// ll a=((ll)1<<5)-1;
	// ll b=a>>2;
	// ll c=b<<2;
	// cout<<a<<endl;
	// cout<<b<<endl;
	// cout<<c<<endl;
	return 0;
}
0