結果

問題 No.1509 Swap!!
ユーザー trineutrontrineutron
提出日時 2021-05-14 22:59:48
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 343 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 86 ms
使用メモリ 7,856 KB
最終ジャッジ日時 2022-11-25 21:02:29
合計ジャッジ時間 11,125 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 14 ms
7,856 KB
testcase_01 AC 15 ms
7,756 KB
testcase_02 AC 293 ms
7,716 KB
testcase_03 AC 289 ms
7,816 KB
testcase_04 AC 297 ms
7,640 KB
testcase_05 AC 289 ms
7,828 KB
testcase_06 AC 303 ms
7,716 KB
testcase_07 AC 301 ms
7,628 KB
testcase_08 AC 312 ms
7,640 KB
testcase_09 AC 289 ms
7,660 KB
testcase_10 AC 288 ms
7,636 KB
testcase_11 AC 331 ms
7,828 KB
testcase_12 AC 324 ms
7,660 KB
testcase_13 AC 331 ms
7,640 KB
testcase_14 AC 336 ms
7,768 KB
testcase_15 AC 341 ms
7,764 KB
testcase_16 AC 343 ms
7,848 KB
testcase_17 AC 331 ms
7,816 KB
testcase_18 AC 316 ms
7,768 KB
testcase_19 AC 335 ms
7,668 KB
testcase_20 AC 332 ms
7,792 KB
testcase_21 AC 293 ms
7,720 KB
testcase_22 AC 300 ms
7,672 KB
testcase_23 AC 292 ms
7,768 KB
testcase_24 AC 300 ms
7,784 KB
testcase_25 AC 303 ms
7,668 KB
testcase_26 AC 300 ms
7,760 KB
testcase_27 AC 274 ms
7,828 KB
testcase_28 AC 273 ms
7,724 KB
testcase_29 AC 273 ms
7,828 KB
testcase_30 AC 338 ms
7,824 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