結果

問題 No.814 ジジ抜き
ユーザー chocoruskchocorusk
提出日時 2019-04-12 22:28:15
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 286 ms / 3,000 ms
コード長 886 bytes
コンパイル時間 2,561 ms
コンパイル使用メモリ 93,516 KB
実行使用メモリ 4,992 KB
最終ジャッジ日時 2023-10-12 21:59:37
合計ジャッジ時間 8,765 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,968 KB
testcase_01 AC 1 ms
4,976 KB
testcase_02 AC 1 ms
4,972 KB
testcase_03 AC 4 ms
4,984 KB
testcase_04 AC 283 ms
4,968 KB
testcase_05 AC 286 ms
4,968 KB
testcase_06 AC 286 ms
4,972 KB
testcase_07 AC 145 ms
4,992 KB
testcase_08 AC 281 ms
4,972 KB
testcase_09 AC 207 ms
4,972 KB
testcase_10 AC 275 ms
4,988 KB
testcase_11 AC 280 ms
4,972 KB
testcase_12 AC 143 ms
4,972 KB
testcase_13 AC 145 ms
4,992 KB
testcase_14 AC 218 ms
4,972 KB
testcase_15 AC 111 ms
4,972 KB
testcase_16 AC 111 ms
4,972 KB
testcase_17 AC 228 ms
4,972 KB
testcase_18 AC 195 ms
4,976 KB
testcase_19 AC 274 ms
4,988 KB
testcase_20 AC 143 ms
4,988 KB
testcase_21 AC 163 ms
4,972 KB
testcase_22 AC 235 ms
4,972 KB
testcase_23 AC 119 ms
4,968 KB
testcase_24 AC 204 ms
4,988 KB
testcase_25 AC 167 ms
4,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
ll solve(ll x){
    if(x<=0) return 0;
    if(x%4==1) return 1;
    else if(x%4==3) return 0;
    else if(x%4==2) return x^(1ll);
    else return x;
}
int main()
{
    int n; cin>>n;
    ll ans=0;
    for(int i=0; i<n; i++){
        ll k, l, d; cin>>k>>l>>d;
        ll l1=l%(1ll<<d);
        if(k%2==1) ans^=l1;
        l>>=d;
        ll t=solve(l-1)^solve(l+k-1);
        t<<=d;
        ans^=t;
    }
    cout<<ans<<endl;
    return 0;
}
0