結果

問題 No.1509 Swap!!
ユーザー startcppstartcpp
提出日時 2021-05-14 22:45:09
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 246 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 65,072 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 01:49:22
合計ジャッジ時間 8,624 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 201 ms
6,944 KB
testcase_03 AC 204 ms
6,940 KB
testcase_04 AC 203 ms
6,940 KB
testcase_05 AC 200 ms
6,944 KB
testcase_06 AC 200 ms
6,944 KB
testcase_07 AC 199 ms
6,944 KB
testcase_08 AC 199 ms
6,940 KB
testcase_09 AC 201 ms
6,940 KB
testcase_10 AC 201 ms
6,940 KB
testcase_11 AC 241 ms
6,944 KB
testcase_12 AC 245 ms
6,944 KB
testcase_13 AC 243 ms
6,940 KB
testcase_14 AC 245 ms
6,940 KB
testcase_15 AC 243 ms
6,940 KB
testcase_16 AC 240 ms
6,944 KB
testcase_17 AC 246 ms
6,944 KB
testcase_18 AC 242 ms
6,940 KB
testcase_19 AC 243 ms
6,940 KB
testcase_20 AC 243 ms
6,944 KB
testcase_21 AC 201 ms
6,940 KB
testcase_22 AC 199 ms
6,944 KB
testcase_23 AC 200 ms
6,944 KB
testcase_24 AC 201 ms
6,944 KB
testcase_25 AC 201 ms
6,940 KB
testcase_26 AC 200 ms
6,944 KB
testcase_27 AC 147 ms
6,940 KB
testcase_28 AC 148 ms
6,940 KB
testcase_29 AC 148 ms
6,944 KB
testcase_30 AC 244 ms
6,940 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