結果

問題 No.1509 Swap!!
ユーザー pockynypockyny
提出日時 2021-05-14 22:37:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 69,676 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 01:20:04
合計ジャッジ時間 8,740 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 194 ms
6,940 KB
testcase_03 AC 198 ms
6,944 KB
testcase_04 AC 200 ms
6,944 KB
testcase_05 AC 194 ms
6,944 KB
testcase_06 AC 199 ms
6,940 KB
testcase_07 AC 200 ms
6,944 KB
testcase_08 AC 194 ms
6,944 KB
testcase_09 AC 194 ms
6,940 KB
testcase_10 AC 201 ms
6,940 KB
testcase_11 AC 237 ms
6,940 KB
testcase_12 AC 242 ms
6,944 KB
testcase_13 AC 232 ms
6,940 KB
testcase_14 AC 230 ms
6,940 KB
testcase_15 AC 236 ms
6,940 KB
testcase_16 AC 234 ms
6,944 KB
testcase_17 AC 232 ms
6,940 KB
testcase_18 AC 236 ms
6,940 KB
testcase_19 AC 237 ms
6,944 KB
testcase_20 AC 241 ms
6,944 KB
testcase_21 AC 192 ms
6,940 KB
testcase_22 AC 191 ms
6,944 KB
testcase_23 AC 195 ms
6,940 KB
testcase_24 AC 190 ms
6,940 KB
testcase_25 AC 199 ms
6,940 KB
testcase_26 AC 194 ms
6,940 KB
testcase_27 AC 143 ms
6,940 KB
testcase_28 AC 144 ms
6,940 KB
testcase_29 AC 141 ms
6,940 KB
testcase_30 AC 234 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
typedef long long ll;
ll gcd(ll x,ll y){
    if(x<y) swap(x,y);
    if(y==0) return x;
    return gcd(x%y,y);
}
int main(){
    ll t; cin >> t;
    while(t){
        t--;
        ll n,a,b; cin >> n >> a >> b;
        if(gcd(a,b)==1 && a + b - 2<n) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}
0