結果
問題 |
No.790 ちきんの括弧並べ
|
ユーザー |
|
提出日時 | 2019-02-22 13:45:15 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 536 bytes |
コンパイル時間 | 684 ms |
コンパイル使用メモリ | 115,796 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-13 04:10:20 |
合計ジャッジ時間 | 1,320 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.string; immutable long MOD = 998244353; void main() { auto N = readln.chomp.to!int; auto dp = new long[][](N*2+1, N+1); dp[0][0] = 1; foreach (i; 0..2*N) { foreach (j; 0..N+1) { if (j > 0) dp[i+1][j-1] += dp[i][j]; if (j < N) dp[i+1][j+1] += dp[i][j]; } } dp[2*N][0].writeln; }