結果
問題 | No.1106 🦉 何事もバランスが大事 |
ユーザー | vwxyz |
提出日時 | 2023-02-11 18:41:51 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 176 ms / 2,000 ms |
コード長 | 1,207 bytes |
コンパイル時間 | 152 ms |
コンパイル使用メモリ | 82,112 KB |
実行使用メモリ | 91,928 KB |
最終ジャッジ日時 | 2024-07-08 06:03:59 |
合計ジャッジ時間 | 14,936 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 120 ms
89,520 KB |
testcase_01 | AC | 126 ms
89,396 KB |
testcase_02 | AC | 125 ms
89,568 KB |
testcase_03 | AC | 125 ms
89,448 KB |
testcase_04 | AC | 153 ms
91,152 KB |
testcase_05 | AC | 123 ms
89,548 KB |
testcase_06 | AC | 124 ms
89,544 KB |
testcase_07 | AC | 127 ms
89,448 KB |
testcase_08 | AC | 123 ms
89,612 KB |
testcase_09 | AC | 121 ms
89,572 KB |
testcase_10 | AC | 123 ms
89,276 KB |
testcase_11 | AC | 125 ms
89,536 KB |
testcase_12 | AC | 129 ms
89,280 KB |
testcase_13 | AC | 127 ms
89,728 KB |
testcase_14 | AC | 134 ms
90,220 KB |
testcase_15 | AC | 132 ms
89,980 KB |
testcase_16 | AC | 128 ms
90,260 KB |
testcase_17 | AC | 131 ms
90,104 KB |
testcase_18 | AC | 131 ms
90,052 KB |
testcase_19 | AC | 132 ms
90,192 KB |
testcase_20 | AC | 139 ms
90,508 KB |
testcase_21 | AC | 149 ms
90,820 KB |
testcase_22 | AC | 144 ms
90,500 KB |
testcase_23 | AC | 151 ms
90,720 KB |
testcase_24 | AC | 157 ms
91,696 KB |
testcase_25 | AC | 161 ms
91,536 KB |
testcase_26 | AC | 161 ms
91,464 KB |
testcase_27 | AC | 166 ms
91,560 KB |
testcase_28 | AC | 156 ms
90,936 KB |
testcase_29 | AC | 150 ms
91,092 KB |
testcase_30 | AC | 155 ms
91,588 KB |
testcase_31 | AC | 162 ms
91,616 KB |
testcase_32 | AC | 169 ms
91,808 KB |
testcase_33 | AC | 176 ms
91,720 KB |
testcase_34 | AC | 175 ms
91,584 KB |
testcase_35 | AC | 172 ms
91,660 KB |
testcase_36 | AC | 169 ms
91,640 KB |
testcase_37 | AC | 163 ms
91,748 KB |
testcase_38 | AC | 156 ms
91,472 KB |
testcase_39 | AC | 176 ms
91,784 KB |
testcase_40 | AC | 158 ms
91,644 KB |
testcase_41 | AC | 162 ms
90,876 KB |
testcase_42 | AC | 163 ms
91,248 KB |
testcase_43 | AC | 161 ms
90,924 KB |
testcase_44 | AC | 160 ms
91,204 KB |
testcase_45 | AC | 162 ms
90,940 KB |
testcase_46 | AC | 161 ms
91,608 KB |
testcase_47 | AC | 170 ms
91,564 KB |
testcase_48 | AC | 161 ms
91,592 KB |
testcase_49 | AC | 156 ms
91,560 KB |
testcase_50 | AC | 161 ms
91,476 KB |
testcase_51 | AC | 151 ms
91,104 KB |
testcase_52 | AC | 163 ms
91,860 KB |
testcase_53 | AC | 164 ms
91,456 KB |
testcase_54 | AC | 158 ms
91,200 KB |
testcase_55 | AC | 170 ms
91,788 KB |
testcase_56 | AC | 159 ms
91,156 KB |
testcase_57 | AC | 156 ms
90,804 KB |
testcase_58 | AC | 159 ms
91,084 KB |
testcase_59 | AC | 173 ms
91,436 KB |
testcase_60 | AC | 167 ms
91,508 KB |
testcase_61 | AC | 164 ms
91,596 KB |
testcase_62 | AC | 166 ms
91,588 KB |
testcase_63 | AC | 163 ms
91,556 KB |
testcase_64 | AC | 163 ms
91,308 KB |
testcase_65 | AC | 162 ms
91,132 KB |
testcase_66 | AC | 165 ms
91,200 KB |
testcase_67 | AC | 172 ms
91,796 KB |
testcase_68 | AC | 169 ms
91,372 KB |
testcase_69 | AC | 164 ms
91,756 KB |
testcase_70 | AC | 166 ms
91,872 KB |
testcase_71 | AC | 159 ms
91,400 KB |
testcase_72 | AC | 166 ms
91,868 KB |
testcase_73 | AC | 171 ms
91,868 KB |
testcase_74 | AC | 162 ms
91,928 KB |
testcase_75 | AC | 159 ms
91,036 KB |
testcase_76 | AC | 158 ms
91,044 KB |
testcase_77 | AC | 151 ms
91,084 KB |
testcase_78 | AC | 156 ms
90,936 KB |
testcase_79 | AC | 157 ms
91,072 KB |
testcase_80 | AC | 150 ms
91,296 KB |
testcase_81 | AC | 156 ms
90,888 KB |
ソースコード
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)