結果
問題 |
No.814 ジジ抜き
|
ユーザー |
![]() |
提出日時 | 2018-01-23 17:15:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 684 bytes |
コンパイル時間 | 533 ms |
コンパイル使用メモリ | 64,640 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 03:02:26 |
合計ジャッジ時間 | 3,882 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 RE * 1 |
ソースコード
// validator #include <cstdio> #include <iostream> 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); if(N<0 || N>1e6){ cerr<<"invalid N: "<<N<<endl; return -1; } ll x = 0; rep(i, N){ ll K, L, D; scanf("%lld%lld%lld", &K, &L, &D); if(K<1||L<0||L>1e18||K>1e18||(L+((K-1)<<D))>1e18||K-1>(((ll)(1e18-L)>>D)+10)){ cerr<<"invalide K L D: "<<K<<" "<<L<<" "<<D<<endl; return -1; } 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; }