結果

問題 No.1509 Swap!!
ユーザー auauaauaua
提出日時 2021-05-14 23:15:51
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 913 bytes
コンパイル時間 2,505 ms
使用メモリ 3,552 KB
最終ジャッジ日時 2022-11-25 22:12:01
合計ジャッジ時間 8,280 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,440 KB
testcase_01 AC 1 ms
3,520 KB
testcase_02 AC 160 ms
3,436 KB
testcase_03 AC 158 ms
3,524 KB
testcase_04 AC 153 ms
3,528 KB
testcase_05 AC 156 ms
3,424 KB
testcase_06 AC 158 ms
3,444 KB
testcase_07 AC 162 ms
3,536 KB
testcase_08 AC 159 ms
3,444 KB
testcase_09 AC 163 ms
3,440 KB
testcase_10 AC 160 ms
3,552 KB
testcase_11 AC 198 ms
3,440 KB
testcase_12 AC 201 ms
3,440 KB
testcase_13 AC 191 ms
3,448 KB
testcase_14 AC 197 ms
3,372 KB
testcase_15 AC 193 ms
3,424 KB
testcase_16 AC 191 ms
3,424 KB
testcase_17 AC 190 ms
3,440 KB
testcase_18 AC 192 ms
3,524 KB
testcase_19 AC 195 ms
3,548 KB
testcase_20 AC 197 ms
3,424 KB
testcase_21 AC 158 ms
3,372 KB
testcase_22 AC 158 ms
3,524 KB
testcase_23 AC 157 ms
3,532 KB
testcase_24 AC 154 ms
3,552 KB
testcase_25 AC 157 ms
3,444 KB
testcase_26 AC 156 ms
3,540 KB
testcase_27 AC 115 ms
3,540 KB
testcase_28 AC 111 ms
3,420 KB
testcase_29 AC 115 ms
3,372 KB
testcase_30 AC 201 ms
3,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=998244353;
const ll inf=INF*INF;
const ll mod=MOD;
const ll MAX=200010;

//gcd
ll gcd(ll a,ll b){
    if(b==0)return a;
    return gcd(b,a%b);
}

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