結果

問題 No.1229 ラグビーの得点パターン
ユーザー kou_kkk
提出日時 2024-03-26 18:13:50
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 3,106 ms
コンパイル使用メモリ 65,248 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-09-30 14:25:11
合計ジャッジ時間 4,353 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils

const
  ps = [3, 5, 7]
let
  n = parseInt readLine stdin
var
  cnts = 0.repeat n.succ

cnts[0] = 1

for p in ps:
  for i in countdown(n.pred(p), 0):
    if cnts[i] != 0:
      for j in countup(i.succ(p), n, p):
        cnts[j].inc cnts[i]

echo cnts[n]
0