結果
問題 | No.1462 最弱WEAKER |
ユーザー |
![]() |
提出日時 | 2023-04-29 03:49:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 35 ms / 2,000 ms |
コード長 | 324 bytes |
コンパイル時間 | 331 ms |
コンパイル使用メモリ | 81,960 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-11-18 02:45:44 |
合計ジャッジ時間 | 1,934 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
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")