結果

問題 No.1509 Swap!!
ユーザー kotatsugamekotatsugame
提出日時 2021-05-14 23:32:43
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 439 ms
使用メモリ 3,536 KB
最終ジャッジ日時 2022-11-25 23:00:59
合計ジャッジ時間 8,144 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
3,376 KB
testcase_01 AC 1 ms
3,448 KB
testcase_02 AC 167 ms
3,496 KB
testcase_03 AC 163 ms
3,420 KB
testcase_04 AC 167 ms
3,440 KB
testcase_05 AC 166 ms
3,472 KB
testcase_06 AC 171 ms
3,440 KB
testcase_07 AC 172 ms
3,440 KB
testcase_08 AC 173 ms
3,436 KB
testcase_09 AC 171 ms
3,440 KB
testcase_10 AC 169 ms
3,440 KB
testcase_11 AC 209 ms
3,536 KB
testcase_12 AC 208 ms
3,440 KB
testcase_13 AC 208 ms
3,440 KB
testcase_14 AC 205 ms
3,444 KB
testcase_15 AC 208 ms
3,516 KB
testcase_16 AC 207 ms
3,380 KB
testcase_17 AC 209 ms
3,440 KB
testcase_18 AC 208 ms
3,368 KB
testcase_19 AC 205 ms
3,416 KB
testcase_20 AC 213 ms
3,436 KB
testcase_21 AC 171 ms
3,496 KB
testcase_22 AC 171 ms
3,380 KB
testcase_23 AC 170 ms
3,492 KB
testcase_24 AC 170 ms
3,472 KB
testcase_25 AC 171 ms
3,420 KB
testcase_26 AC 169 ms
3,444 KB
testcase_27 AC 119 ms
3,496 KB
testcase_28 AC 120 ms
3,492 KB
testcase_29 AC 117 ms
3,420 KB
testcase_30 AC 212 ms
3,440 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
long gcd(long a,long b){return b?gcd(b,a%b):a;}
int T;
main()
{
	cin>>T;
	for(;T--;)
	{
		long N,A,B;
		cin>>N>>A>>B;
		if(A>B)swap(A,B);
		if(gcd(A,B)>1)
		{
			cout<<"NO"<<endl;
			continue;
		}
		if(A-1<=N-B)
		{
			cout<<"YES"<<endl;
		}
		else cout<<"NO"<<endl;
	}
}
0