結果

問題 No.1509 Swap!!
ユーザー startcppstartcpp
提出日時 2021-05-14 22:45:09
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 500 ms
使用メモリ 3,596 KB
最終ジャッジ日時 2022-11-25 20:19:48
合計ジャッジ時間 7,864 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,512 KB
testcase_01 AC 1 ms
3,372 KB
testcase_02 AC 168 ms
3,432 KB
testcase_03 AC 166 ms
3,488 KB
testcase_04 AC 170 ms
3,440 KB
testcase_05 AC 166 ms
3,492 KB
testcase_06 AC 166 ms
3,464 KB
testcase_07 AC 169 ms
3,492 KB
testcase_08 AC 168 ms
3,440 KB
testcase_09 AC 170 ms
3,484 KB
testcase_10 AC 167 ms
3,412 KB
testcase_11 AC 210 ms
3,368 KB
testcase_12 AC 213 ms
3,508 KB
testcase_13 AC 209 ms
3,596 KB
testcase_14 AC 210 ms
3,484 KB
testcase_15 AC 203 ms
3,472 KB
testcase_16 AC 211 ms
3,484 KB
testcase_17 AC 213 ms
3,484 KB
testcase_18 AC 210 ms
3,436 KB
testcase_19 AC 206 ms
3,472 KB
testcase_20 AC 199 ms
3,468 KB
testcase_21 AC 168 ms
3,488 KB
testcase_22 AC 168 ms
3,372 KB
testcase_23 AC 168 ms
3,508 KB
testcase_24 AC 168 ms
3,440 KB
testcase_25 AC 170 ms
3,492 KB
testcase_26 AC 171 ms
3,440 KB
testcase_27 AC 120 ms
3,508 KB
testcase_28 AC 122 ms
3,544 KB
testcase_29 AC 121 ms
3,544 KB
testcase_30 AC 209 ms
3,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define int long long
using namespace std;

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

int T;
signed main() {
	cin >> T;
	while (T--) {
		int n, a, b;
		cin >> n >> a >> b;
		int g = gcd(a, b);
		if (g != 1) { cout << "NO" << endl; }
		else if (n < a + b - 1) { cout << "NO" << endl; }
		else { cout << "YES" << endl; }
	}
	return 0;
}
0