結果

問題 No.1895 Mod 2
ユーザー umezoumezo
提出日時 2022-04-08 22:59:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 713 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 207,348 KB
実行使用メモリ 1,065,916 KB
最終ジャッジ日時 2024-05-06 08:41:50
合計ジャッジ時間 8,417 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

const ll MAX=1e15;
const int MM=32000000;

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  vector<ll> A;
  for(int i=3;i<MM;i+=2){
    ll t=(ll)i*i;
    ll tmp=t;
    while(1){
      A.push_back(tmp);
      if(tmp>MAX/2) break;
      tmp*=2;
    }
  }
  ll k=1;
  while(1){
    A.push_back(k);
    if(k>MAX/2) break;
    k*=2;
  }
  sort(ALL(A));
  A.erase(unique(ALL(A)),A.end());
  
  int t;
  cin>>t;
  while(t--){
    ll l,r;
    cin>>l>>r;
    cout<<(upper_bound(ALL(A),r)-lower_bound(ALL(A),l))%2<<endl;
  }
   
  return 0;
}
0