結果

問題 No.1930 XOR of Two Range
ユーザー monnu
提出日時 2022-05-06 23:17:21
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 611 bytes
コンパイル時間 3,904 ms
コンパイル使用メモリ 228,812 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 01:58:45
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define INF 1000000000
#define MOD 998244353
#define MAX 300000

void solve(){
  ll L,R;
  cin>>L>>R;
  int l=R-L+1;
  if(l%8==0){
    cout<<0<<'\n';
  }else if(l%8==1){
    cout<<L+R<<'\n';
  }else if(l%8==2){
    cout<<1<<'\n';
  }else if(l%8==3){
    cout<<1<<'\n';
  }else if(l%8==4){
    cout<<1<<'\n';
  }else if(l%8==5){
    cout<<((L+R)^1)<<'\n';
  }else{
    cout<<0<<'\n';
  }
}

int main(){
  int T;
  cin>>T;
  for(int i=0;i<T;i++){
    solve();
  }
}
0