結果

問題 No.1462 最弱WEAKER
ユーザー 310icecrystal310icecrystal
提出日時 2023-04-29 03:49:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 71,256 KB
最終ジャッジ日時 2023-08-11 10:47:57
合計ジャッジ時間 4,862 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,128 KB
testcase_01 AC 64 ms
71,048 KB
testcase_02 AC 66 ms
71,088 KB
testcase_03 AC 68 ms
71,140 KB
testcase_04 AC 67 ms
71,052 KB
testcase_05 AC 68 ms
71,060 KB
testcase_06 AC 66 ms
71,104 KB
testcase_07 AC 67 ms
70,904 KB
testcase_08 AC 68 ms
70,904 KB
testcase_09 AC 68 ms
71,048 KB
testcase_10 AC 70 ms
71,180 KB
testcase_11 AC 68 ms
71,008 KB
testcase_12 AC 64 ms
71,120 KB
testcase_13 AC 66 ms
70,892 KB
testcase_14 AC 65 ms
70,984 KB
testcase_15 AC 67 ms
71,180 KB
testcase_16 AC 66 ms
70,952 KB
testcase_17 AC 63 ms
71,084 KB
testcase_18 AC 68 ms
71,256 KB
testcase_19 AC 66 ms
71,096 KB
testcase_20 AC 66 ms
71,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def base_n(num_10,n):
    str_n = ''
    while num_10:
        if num_10%n>=10:
            return -1
        str_n += str(num_10%n)
        num_10 //= n
    return int(str_n[::-1])

N = int(input())
S = str(base_n(N,3))
g = 0
for i in range(len(S)):
    g += int(S[i])

if g % 2 == 1:
    print("NO")
else:
    print("YES")
0