結果

問題 No.1185 完全な3の倍数
ユーザー kozykozy
提出日時 2020-08-22 14:44:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 77,548 KB
最終ジャッジ日時 2023-08-16 00:09:07
合計ジャッジ時間 11,152 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 270 ms
77,340 KB
testcase_01 AC 66 ms
71,564 KB
testcase_02 AC 251 ms
77,272 KB
testcase_03 AC 254 ms
77,412 KB
testcase_04 AC 264 ms
77,236 KB
testcase_05 AC 262 ms
77,420 KB
testcase_06 AC 259 ms
77,388 KB
testcase_07 AC 256 ms
77,340 KB
testcase_08 AC 271 ms
77,488 KB
testcase_09 AC 67 ms
71,324 KB
testcase_10 AC 65 ms
71,352 KB
testcase_11 AC 68 ms
71,396 KB
testcase_12 AC 67 ms
71,496 KB
testcase_13 AC 66 ms
71,332 KB
testcase_14 AC 66 ms
71,428 KB
testcase_15 AC 67 ms
71,316 KB
testcase_16 AC 69 ms
71,228 KB
testcase_17 AC 67 ms
71,188 KB
testcase_18 AC 64 ms
71,436 KB
testcase_19 AC 253 ms
77,376 KB
testcase_20 AC 255 ms
77,548 KB
testcase_21 AC 269 ms
77,236 KB
testcase_22 AC 262 ms
77,184 KB
testcase_23 AC 256 ms
77,176 KB
testcase_24 AC 261 ms
77,420 KB
testcase_25 AC 271 ms
77,168 KB
testcase_26 AC 259 ms
77,376 KB
testcase_27 AC 259 ms
77,236 KB
testcase_28 AC 272 ms
77,284 KB
testcase_29 AC 266 ms
77,380 KB
testcase_30 AC 265 ms
77,340 KB
testcase_31 AC 264 ms
77,216 KB
testcase_32 AC 264 ms
77,432 KB
testcase_33 AC 258 ms
77,384 KB
testcase_34 AC 265 ms
77,428 KB
testcase_35 AC 266 ms
77,404 KB
testcase_36 AC 261 ms
77,420 KB
testcase_37 AC 260 ms
77,392 KB
testcase_38 AC 265 ms
77,412 KB
testcase_39 AC 67 ms
71,532 KB
testcase_40 AC 267 ms
77,268 KB
testcase_41 AC 262 ms
77,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())
def NIJIGEN(H): return [list(input()) for i in range(H)]
def a(X):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%4)+out
        X_dumy = int(X_dumy/4)
    return out
N=int(input())
ans=0
if N<=10:
  print(0)
  exit()
if N<=99:
    print((N//3)-3)
    exit()
for i in range(16,262144):
  s=list(a(i))
  s="".join([str(3*int(i)) for i in s])
  s=int(s)
  if s<=N:
    ans+=1
print(ans+30)
0