結果

問題 No.136 Yet Another GCD Problem
ユーザー roarisroaris
提出日時 2019-08-11 16:09:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 76,408 KB
最終ジャッジ日時 2023-10-11 21:15:41
合計ジャッジ時間 6,215 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,332 KB
testcase_01 AC 74 ms
71,208 KB
testcase_02 AC 74 ms
71,052 KB
testcase_03 AC 100 ms
76,392 KB
testcase_04 AC 104 ms
76,160 KB
testcase_05 AC 87 ms
76,384 KB
testcase_06 AC 83 ms
75,652 KB
testcase_07 AC 86 ms
76,152 KB
testcase_08 AC 93 ms
76,156 KB
testcase_09 AC 81 ms
76,168 KB
testcase_10 AC 94 ms
76,392 KB
testcase_11 AC 100 ms
76,060 KB
testcase_12 AC 79 ms
74,860 KB
testcase_13 AC 91 ms
76,136 KB
testcase_14 AC 105 ms
76,136 KB
testcase_15 AC 104 ms
76,304 KB
testcase_16 AC 101 ms
76,392 KB
testcase_17 AC 98 ms
76,408 KB
testcase_18 AC 78 ms
74,788 KB
testcase_19 AC 98 ms
76,240 KB
testcase_20 AC 95 ms
76,120 KB
testcase_21 AC 81 ms
75,852 KB
testcase_22 AC 75 ms
71,332 KB
testcase_23 AC 75 ms
71,204 KB
testcase_24 AC 75 ms
70,932 KB
testcase_25 AC 75 ms
71,252 KB
testcase_26 AC 79 ms
75,084 KB
testcase_27 AC 100 ms
76,244 KB
testcase_28 AC 97 ms
76,068 KB
testcase_29 AC 84 ms
75,600 KB
testcase_30 AC 74 ms
71,380 KB
testcase_31 AC 74 ms
71,076 KB
testcase_32 AC 74 ms
71,252 KB
testcase_33 AC 74 ms
71,296 KB
testcase_34 AC 90 ms
76,404 KB
testcase_35 AC 96 ms
76,296 KB
testcase_36 AC 86 ms
75,960 KB
testcase_37 AC 105 ms
76,096 KB
testcase_38 AC 76 ms
70,984 KB
testcase_39 AC 76 ms
71,216 KB
testcase_40 AC 76 ms
71,080 KB
testcase_41 AC 76 ms
71,332 KB
権限があれば一括ダウンロードができます

ソースコード

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