結果

問題 No.1106 🦉 何事もバランスが大事
ユーザー vwxyzvwxyz
提出日時 2023-02-11 18:42:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 1,207 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 10,980 KB
最終ジャッジ日時 2023-09-22 14:28:48
合計ジャッジ時間 5,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,476 KB
testcase_01 AC 33 ms
10,472 KB
testcase_02 AC 34 ms
10,580 KB
testcase_03 AC 32 ms
10,420 KB
testcase_04 AC 37 ms
10,864 KB
testcase_05 AC 31 ms
10,528 KB
testcase_06 AC 32 ms
10,460 KB
testcase_07 AC 32 ms
10,452 KB
testcase_08 AC 33 ms
10,420 KB
testcase_09 AC 33 ms
10,464 KB
testcase_10 AC 33 ms
10,392 KB
testcase_11 AC 33 ms
10,352 KB
testcase_12 AC 33 ms
10,480 KB
testcase_13 AC 32 ms
10,512 KB
testcase_14 AC 32 ms
10,556 KB
testcase_15 AC 33 ms
10,572 KB
testcase_16 AC 34 ms
10,416 KB
testcase_17 AC 33 ms
10,416 KB
testcase_18 AC 34 ms
10,456 KB
testcase_19 AC 34 ms
10,536 KB
testcase_20 AC 35 ms
10,676 KB
testcase_21 AC 34 ms
10,508 KB
testcase_22 AC 35 ms
10,628 KB
testcase_23 AC 35 ms
10,728 KB
testcase_24 AC 35 ms
10,704 KB
testcase_25 AC 37 ms
10,784 KB
testcase_26 AC 36 ms
10,820 KB
testcase_27 AC 36 ms
10,844 KB
testcase_28 AC 36 ms
10,876 KB
testcase_29 AC 37 ms
10,808 KB
testcase_30 AC 36 ms
10,808 KB
testcase_31 AC 35 ms
10,796 KB
testcase_32 AC 36 ms
10,892 KB
testcase_33 AC 36 ms
10,800 KB
testcase_34 AC 35 ms
10,792 KB
testcase_35 AC 35 ms
10,832 KB
testcase_36 AC 36 ms
10,892 KB
testcase_37 AC 36 ms
10,792 KB
testcase_38 AC 37 ms
10,876 KB
testcase_39 AC 37 ms
10,824 KB
testcase_40 AC 36 ms
10,824 KB
testcase_41 AC 37 ms
10,792 KB
testcase_42 AC 37 ms
10,836 KB
testcase_43 AC 37 ms
10,748 KB
testcase_44 AC 37 ms
10,820 KB
testcase_45 AC 37 ms
10,740 KB
testcase_46 AC 37 ms
10,980 KB
testcase_47 AC 37 ms
10,828 KB
testcase_48 AC 37 ms
10,888 KB
testcase_49 AC 37 ms
10,748 KB
testcase_50 AC 38 ms
10,864 KB
testcase_51 AC 34 ms
10,668 KB
testcase_52 AC 36 ms
10,792 KB
testcase_53 AC 37 ms
10,816 KB
testcase_54 AC 37 ms
10,816 KB
testcase_55 AC 38 ms
10,796 KB
testcase_56 AC 38 ms
10,820 KB
testcase_57 AC 36 ms
10,864 KB
testcase_58 AC 38 ms
10,828 KB
testcase_59 AC 37 ms
10,784 KB
testcase_60 AC 37 ms
10,828 KB
testcase_61 AC 37 ms
10,756 KB
testcase_62 AC 37 ms
10,744 KB
testcase_63 AC 36 ms
10,908 KB
testcase_64 AC 37 ms
10,864 KB
testcase_65 AC 35 ms
10,612 KB
testcase_66 AC 37 ms
10,896 KB
testcase_67 AC 36 ms
10,936 KB
testcase_68 AC 37 ms
10,764 KB
testcase_69 AC 36 ms
10,844 KB
testcase_70 AC 37 ms
10,908 KB
testcase_71 AC 36 ms
10,844 KB
testcase_72 AC 37 ms
10,872 KB
testcase_73 AC 37 ms
10,820 KB
testcase_74 AC 37 ms
10,840 KB
testcase_75 AC 36 ms
10,960 KB
testcase_76 AC 37 ms
10,852 KB
testcase_77 AC 38 ms
10,956 KB
testcase_78 AC 37 ms
10,908 KB
testcase_79 AC 37 ms
10,852 KB
testcase_80 AC 37 ms
10,844 KB
testcase_81 AC 37 ms
10,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
import time
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines
write=sys.stdout.write
sys.setrecursionlimit(10**6)

@lru_cache(maxsize=None)
def solve(N,cnt):
    if N<=3:
        retu=0
        for n in range(1,N):
            if n==cnt:
                retu+=1
    else:
        retu=0
        for n in range(1,3):
            if n==cnt:
                retu+=1
        retu+=solve((N+4)//5,cnt)
        retu+=solve((N+3)//5,cnt-1)
        retu+=solve((N+2)//5,cnt-2)
        retu+=solve((N+6)//5,cnt+2)
        retu+=solve((N+5)//5,cnt+1)
    return retu

N=int(readline())
ans=solve(N+1,0)
print(ans)
0