結果

問題 No.1509 Swap!!
ユーザー trineutrontrineutron
提出日時 2021-05-14 22:59:48
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 410 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 10,560 KB
実行使用メモリ 8,108 KB
最終ジャッジ日時 2023-07-25 09:04:22
合計ジャッジ時間 14,067 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,900 KB
testcase_01 AC 19 ms
7,904 KB
testcase_02 AC 365 ms
8,000 KB
testcase_03 AC 363 ms
7,896 KB
testcase_04 AC 366 ms
8,072 KB
testcase_05 AC 364 ms
8,056 KB
testcase_06 AC 364 ms
7,996 KB
testcase_07 AC 365 ms
8,068 KB
testcase_08 AC 363 ms
7,896 KB
testcase_09 AC 370 ms
8,016 KB
testcase_10 AC 364 ms
8,076 KB
testcase_11 AC 407 ms
7,992 KB
testcase_12 AC 406 ms
7,968 KB
testcase_13 AC 409 ms
7,964 KB
testcase_14 AC 402 ms
7,972 KB
testcase_15 AC 402 ms
8,104 KB
testcase_16 AC 402 ms
7,996 KB
testcase_17 AC 404 ms
7,876 KB
testcase_18 AC 404 ms
7,904 KB
testcase_19 AC 410 ms
8,052 KB
testcase_20 AC 405 ms
7,904 KB
testcase_21 AC 363 ms
7,900 KB
testcase_22 AC 361 ms
7,900 KB
testcase_23 AC 357 ms
7,892 KB
testcase_24 AC 363 ms
8,108 KB
testcase_25 AC 372 ms
7,956 KB
testcase_26 AC 377 ms
7,900 KB
testcase_27 AC 326 ms
8,024 KB
testcase_28 AC 325 ms
8,052 KB
testcase_29 AC 331 ms
7,880 KB
testcase_30 AC 402 ms
8,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def solve():
    n, a, b = map(int, input().split())
    if a > b:
        a, b = b, a
    if math.gcd(a, b) != 1:
        print('NO')
        return
    if n - b < a - 1:
        print('NO')
        return
    print('YES')

t = int(input())
for i in range(t):
    solve()
0