結果

問題 No.136 Yet Another GCD Problem
ユーザー roaris
提出日時 2019-08-11 16:09:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 611 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 75,860 KB
最終ジャッジ日時 2024-09-13 20:07:47
合計ジャッジ時間 3,701 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 39
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

N, K = map(int, input().split())
ans = -10 ** 18

for i in range(1, N):
    ans = max(ans, gcd(i, N-i))

print(ans)
0