結果

問題 No.1895 Mod 2
ユーザー cologne
提出日時 2022-04-08 22:19:21
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 2,637 ms
コンパイル使用メモリ 243,940 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-28 13:01:05
合計ジャッジ時間 3,408 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        long l, r;
        cin >> l >> r;
        long v = (int)sqrtl(r) - (int)sqrtl(l - 1);
        v += (int)sqrtl(r / 2) - (int)sqrtl((l - 1) / 2);
        v = v & 1;
        cout << v << endl;
    }
}
0