結果
問題 | No.1509 Swap!! |
ユーザー |
![]() |
提出日時 | 2021-05-14 23:41:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 460 bytes |
コンパイル時間 | 1,602 ms |
コンパイル使用メモリ | 167,368 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-02 05:50:59 |
合計ジャッジ時間 | 3,110 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 30 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; using pint = pair<ll,ll>; // #include"debug.hpp" bool f(ll x, ll y, ll N) { if(__gcd(x, y) != 1) return false; if(y * 2 <= N)return true; ll pos = N - y; // print(pos); if(pos + 1 >= x) { return true; } return false; } int main() { ll N; cin >> N; ll x, y; cin >> x >> y; if(x > y)swap(x, y); if(f(x, y, N)) { cout << "YES" << endl; } else { cout << "NO" << endl; } }