結果

問題 No.1509 Swap!!
ユーザー Haa
提出日時 2021-05-14 22:54:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 241 ms / 2,000 ms
コード長 615 bytes
コンパイル時間 1,685 ms
コンパイル使用メモリ 167,316 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-02 03:22:22
合計ジャッジ時間 9,653 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=998244353;
constexpr ll INF=2e18;

int main(){
    int t; cin >> t;
    while(t--){
        ll n, a, b; cin >> n >> a >> b;
        if(a<b) swap(a,b);
        ll g=__gcd(a,b);
        if(g!=1){
            cout << "NO"<< endl;
            continue;
        }
        if(b-1>n-a){
            cout << "NO" << endl;
            continue;
        }
        cout << "YES" << endl;
    }
}
0