結果

問題 No.1106 🦉 何事もバランスが大事
ユーザー vwxyzvwxyz
提出日時 2023-02-11 18:41:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 1,207 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 97,592 KB
最終ジャッジ日時 2023-09-22 14:28:12
合計ジャッジ時間 28,777 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 252 ms
91,704 KB
testcase_01 AC 252 ms
91,664 KB
testcase_02 AC 251 ms
91,688 KB
testcase_03 AC 255 ms
91,412 KB
testcase_04 AC 291 ms
95,224 KB
testcase_05 AC 255 ms
91,444 KB
testcase_06 AC 252 ms
91,548 KB
testcase_07 AC 255 ms
91,744 KB
testcase_08 AC 249 ms
91,664 KB
testcase_09 AC 250 ms
91,676 KB
testcase_10 AC 249 ms
91,804 KB
testcase_11 AC 258 ms
91,452 KB
testcase_12 AC 255 ms
91,476 KB
testcase_13 AC 261 ms
94,096 KB
testcase_14 AC 268 ms
94,856 KB
testcase_15 AC 267 ms
94,676 KB
testcase_16 AC 266 ms
94,856 KB
testcase_17 AC 267 ms
94,744 KB
testcase_18 AC 265 ms
94,488 KB
testcase_19 AC 264 ms
94,504 KB
testcase_20 AC 280 ms
95,156 KB
testcase_21 AC 288 ms
95,728 KB
testcase_22 AC 279 ms
95,300 KB
testcase_23 AC 290 ms
95,312 KB
testcase_24 AC 300 ms
96,968 KB
testcase_25 AC 302 ms
97,396 KB
testcase_26 AC 300 ms
96,360 KB
testcase_27 AC 304 ms
96,600 KB
testcase_28 AC 290 ms
95,172 KB
testcase_29 AC 288 ms
94,988 KB
testcase_30 AC 299 ms
94,864 KB
testcase_31 AC 300 ms
97,120 KB
testcase_32 AC 307 ms
97,552 KB
testcase_33 AC 316 ms
97,264 KB
testcase_34 AC 309 ms
97,352 KB
testcase_35 AC 307 ms
97,352 KB
testcase_36 AC 307 ms
96,804 KB
testcase_37 AC 307 ms
97,464 KB
testcase_38 AC 291 ms
95,100 KB
testcase_39 AC 315 ms
97,320 KB
testcase_40 AC 299 ms
97,024 KB
testcase_41 AC 302 ms
97,192 KB
testcase_42 AC 300 ms
97,080 KB
testcase_43 AC 305 ms
97,340 KB
testcase_44 AC 304 ms
96,976 KB
testcase_45 AC 300 ms
97,132 KB
testcase_46 AC 301 ms
96,680 KB
testcase_47 AC 308 ms
96,676 KB
testcase_48 AC 307 ms
96,952 KB
testcase_49 AC 298 ms
97,116 KB
testcase_50 AC 302 ms
97,592 KB
testcase_51 AC 289 ms
95,480 KB
testcase_52 AC 305 ms
96,772 KB
testcase_53 AC 299 ms
97,012 KB
testcase_54 AC 295 ms
96,464 KB
testcase_55 AC 310 ms
97,136 KB
testcase_56 AC 296 ms
96,476 KB
testcase_57 AC 297 ms
96,608 KB
testcase_58 AC 300 ms
96,356 KB
testcase_59 AC 307 ms
96,756 KB
testcase_60 AC 312 ms
97,260 KB
testcase_61 AC 300 ms
97,272 KB
testcase_62 AC 302 ms
97,372 KB
testcase_63 AC 301 ms
97,160 KB
testcase_64 AC 302 ms
96,636 KB
testcase_65 AC 287 ms
95,796 KB
testcase_66 AC 304 ms
97,248 KB
testcase_67 AC 309 ms
96,488 KB
testcase_68 AC 298 ms
96,824 KB
testcase_69 AC 298 ms
96,652 KB
testcase_70 AC 301 ms
96,656 KB
testcase_71 AC 298 ms
96,716 KB
testcase_72 AC 311 ms
96,984 KB
testcase_73 AC 308 ms
97,084 KB
testcase_74 AC 300 ms
96,852 KB
testcase_75 AC 291 ms
95,224 KB
testcase_76 AC 292 ms
95,236 KB
testcase_77 AC 287 ms
95,164 KB
testcase_78 AC 290 ms
95,164 KB
testcase_79 AC 296 ms
95,276 KB
testcase_80 AC 291 ms
95,208 KB
testcase_81 AC 302 ms
94,996 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**5)

@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