結果

問題 No.1509 Swap!!
ユーザー pockynypockyny
提出日時 2021-05-14 22:37:15
言語 C++17
(gcc 12.2.0 + boost 1.81.0)
結果
AC  
実行時間 237 ms / 2,000 ms
コード長 355 bytes
コンパイル時間 667 ms
コンパイル使用メモリ 67,904 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-07-25 07:57:12
合計ジャッジ時間 8,884 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 194 ms
4,380 KB
testcase_03 AC 192 ms
4,380 KB
testcase_04 AC 191 ms
4,380 KB
testcase_05 AC 195 ms
4,376 KB
testcase_06 AC 192 ms
4,380 KB
testcase_07 AC 194 ms
4,380 KB
testcase_08 AC 195 ms
4,376 KB
testcase_09 AC 197 ms
4,380 KB
testcase_10 AC 193 ms
4,376 KB
testcase_11 AC 234 ms
4,376 KB
testcase_12 AC 235 ms
4,380 KB
testcase_13 AC 234 ms
4,380 KB
testcase_14 AC 233 ms
4,380 KB
testcase_15 AC 237 ms
4,376 KB
testcase_16 AC 232 ms
4,380 KB
testcase_17 AC 231 ms
4,380 KB
testcase_18 AC 232 ms
4,376 KB
testcase_19 AC 234 ms
4,380 KB
testcase_20 AC 232 ms
4,376 KB
testcase_21 AC 191 ms
4,380 KB
testcase_22 AC 191 ms
4,380 KB
testcase_23 AC 193 ms
4,380 KB
testcase_24 AC 194 ms
4,384 KB
testcase_25 AC 195 ms
4,376 KB
testcase_26 AC 197 ms
4,376 KB
testcase_27 AC 141 ms
4,376 KB
testcase_28 AC 143 ms
4,380 KB
testcase_29 AC 143 ms
4,380 KB
testcase_30 AC 234 ms
4,380 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