結果

問題 No.1895 Mod 2
ユーザー ぷらぷら
提出日時 2022-04-08 22:21:34
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 512 bytes
コンパイル時間 2,429 ms
コンパイル使用メモリ 206,328 KB
実行使用メモリ 1,065,936 KB
最終ジャッジ日時 2024-05-06 07:54:16
合計ジャッジ時間 9,075 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 #

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

int main() {
    vector<long long>tmp;
    for(long long i = 1; i*i <= 1000000000000000; i += 2) {
        long long j = i*i;
        while (j <= 1000000000000000) {
            tmp.push_back(j);
            j *= 2;
        }
    }
    sort(tmp.begin(),tmp.end());
    int t;
    cin >> t;
    while (t--) {
        long long l,r;
        cin >> l >> r;
        cout << (upper_bound(tmp.begin(),tmp.end(),r)-lower_bound(tmp.begin(),tmp.end(),l))%2 << endl;
    }
}
0