結果

問題 No.1509 Swap!!
ユーザー kotatsugamekotatsugame
提出日時 2021-05-14 23:32:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 236 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 66,368 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-10 04:07:05
合計ジャッジ時間 8,416 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 193 ms
5,376 KB
testcase_03 AC 204 ms
5,376 KB
testcase_04 AC 192 ms
5,376 KB
testcase_05 AC 191 ms
5,376 KB
testcase_06 AC 194 ms
5,376 KB
testcase_07 AC 195 ms
5,376 KB
testcase_08 AC 202 ms
5,376 KB
testcase_09 AC 202 ms
5,376 KB
testcase_10 AC 199 ms
5,376 KB
testcase_11 AC 228 ms
5,376 KB
testcase_12 AC 236 ms
5,376 KB
testcase_13 AC 226 ms
5,376 KB
testcase_14 AC 232 ms
5,376 KB
testcase_15 AC 226 ms
5,376 KB
testcase_16 AC 233 ms
5,376 KB
testcase_17 AC 229 ms
5,376 KB
testcase_18 AC 230 ms
5,376 KB
testcase_19 AC 230 ms
5,376 KB
testcase_20 AC 225 ms
5,376 KB
testcase_21 AC 207 ms
5,376 KB
testcase_22 AC 190 ms
5,376 KB
testcase_23 AC 187 ms
5,376 KB
testcase_24 AC 196 ms
5,376 KB
testcase_25 AC 189 ms
5,376 KB
testcase_26 AC 185 ms
5,376 KB
testcase_27 AC 137 ms
5,376 KB
testcase_28 AC 141 ms
5,376 KB
testcase_29 AC 138 ms
5,376 KB
testcase_30 AC 230 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-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