結果

問題 No.1509 Swap!!
ユーザー marroncastle
提出日時 2021-05-14 23:26:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 78,464 KB
最終ジャッジ日時 2024-10-02 05:17:34
合計ジャッジ時間 4,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,os,io
input = sys.stdin.readline
#input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
T = int(input())
ans = ['NO']*T
def extgcd(a, b): # ax + by = d
  if b==0:
    return a, 1, 0 # a・1 + b・0 = a (b = 0のとき)
  d, y, x = extgcd(b, a%b)
  y -= (a//b)*x
  return d, x, y
from math import gcd
for t in range(T):
  N, A, B = map(int, input().split())
  if min(A,B)==1:
    ans[t] = 'YES'
  elif gcd(A,B)==1:
    if N >= max(A,B)+1:
      ans[t] = 'YES'
print(*ans, sep='\n')
0