結果

問題 No.1509 Swap!!
ユーザー se1ka2se1ka2
提出日時 2021-05-15 00:01:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 64,816 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 05:09:19
合計ジャッジ時間 8,591 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 202 ms
6,940 KB
testcase_03 AC 201 ms
6,940 KB
testcase_04 AC 200 ms
6,944 KB
testcase_05 AC 201 ms
6,944 KB
testcase_06 AC 202 ms
6,940 KB
testcase_07 AC 202 ms
6,944 KB
testcase_08 AC 203 ms
6,940 KB
testcase_09 AC 204 ms
6,944 KB
testcase_10 AC 202 ms
6,940 KB
testcase_11 AC 243 ms
6,944 KB
testcase_12 AC 242 ms
6,944 KB
testcase_13 AC 242 ms
6,944 KB
testcase_14 AC 241 ms
6,940 KB
testcase_15 AC 241 ms
6,944 KB
testcase_16 AC 239 ms
6,944 KB
testcase_17 AC 240 ms
6,944 KB
testcase_18 AC 243 ms
6,944 KB
testcase_19 AC 244 ms
6,940 KB
testcase_20 AC 240 ms
6,940 KB
testcase_21 AC 200 ms
6,940 KB
testcase_22 AC 200 ms
6,940 KB
testcase_23 AC 200 ms
6,944 KB
testcase_24 AC 204 ms
6,940 KB
testcase_25 AC 201 ms
6,940 KB
testcase_26 AC 202 ms
6,944 KB
testcase_27 AC 149 ms
6,940 KB
testcase_28 AC 147 ms
6,940 KB
testcase_29 AC 146 ms
6,940 KB
testcase_30 AC 244 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

ll gcd(ll n, ll m){
    if(m == 0) return n;
    return gcd(m, n % m);
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        ll n, a, b;
        cin >> n >> a >> b;
        if(gcd(a, b) == 1 && a + b < n + 2) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}
0