結果

問題 No.1509 Swap!!
ユーザー pockynypockyny
提出日時 2021-05-14 22:37:15
言語 C++17
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 443 ms
使用メモリ 3,536 KB
最終ジャッジ日時 2022-11-25 19:47:33
合計ジャッジ時間 8,175 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,360 KB
testcase_01 AC 1 ms
3,368 KB
testcase_02 AC 175 ms
3,432 KB
testcase_03 AC 176 ms
3,532 KB
testcase_04 AC 175 ms
3,420 KB
testcase_05 AC 174 ms
3,368 KB
testcase_06 AC 174 ms
3,468 KB
testcase_07 AC 176 ms
3,520 KB
testcase_08 AC 176 ms
3,536 KB
testcase_09 AC 175 ms
3,472 KB
testcase_10 AC 174 ms
3,480 KB
testcase_11 AC 214 ms
3,364 KB
testcase_12 AC 214 ms
3,440 KB
testcase_13 AC 214 ms
3,364 KB
testcase_14 AC 214 ms
3,364 KB
testcase_15 AC 214 ms
3,488 KB
testcase_16 AC 212 ms
3,368 KB
testcase_17 AC 215 ms
3,524 KB
testcase_18 AC 214 ms
3,484 KB
testcase_19 AC 212 ms
3,368 KB
testcase_20 AC 213 ms
3,480 KB
testcase_21 AC 175 ms
3,528 KB
testcase_22 AC 173 ms
3,432 KB
testcase_23 AC 174 ms
3,524 KB
testcase_24 AC 174 ms
3,364 KB
testcase_25 AC 178 ms
3,428 KB
testcase_26 AC 176 ms
3,484 KB
testcase_27 AC 125 ms
3,420 KB
testcase_28 AC 126 ms
3,488 KB
testcase_29 AC 125 ms
3,364 KB
testcase_30 AC 215 ms
3,488 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