結果
問題 | No.1509 Swap!! |
ユーザー |
![]() |
提出日時 | 2021-05-16 21:17:53 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 83 ms / 2,000 ms |
コード長 | 909 bytes |
コンパイル時間 | 703 ms |
コンパイル使用メモリ | 93,052 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-05 07:47:08 |
合計ジャッジ時間 | 5,661 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 30 |
ソースコード
/* -*- coding: utf-8 -*- * * 1509.cc: No.1509 Swap!! - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int MAX_N = 10000; /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ template <typename T> T gcd(T m, T n) { // m > 0, n > 0 if (m < n) swap(m, n); while (n > 0) { T r = m % n; m = n; n = r; } return m; } /* main */ int main() { int tn; scanf("%d", &tn); while (tn--) { ll n, a, b; scanf("%lld%lld%lld", &n, &a, &b); if (gcd(a, b) == 1 && a - 1 <= n - b) puts("YES"); else puts("NO"); } return 0; }