結果

問題 No.1877 俺自身が線グラフになることだ
ユーザー chineristAC
提出日時 2022-03-18 21:27:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 474 bytes
コンパイル時間 435 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 64,524 KB
最終ジャッジ日時 2024-10-03 06:14:48
合計ジャッジ時間 1,838 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

mod = 10**9 + 7

N = 1000
dp = [0 for j in range(N+1)]
dp[0] = 1

for i in range(3,N+1):
    for j in range(N+1-i):
        dp[j+i] += dp[j]
        dp[j+i] %= mod

print(dp[int(input())])
        
0