結果
問題 |
No.790 ちきんの括弧並べ
|
ユーザー |
|
提出日時 | 2019-02-21 05:50:03 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 157 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 25,984 KB |
最終ジャッジ日時 | 2024-11-15 17:02:19 |
合計ジャッジ時間 | 13,061 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 TLE * 1 |
other | WA * 8 TLE * 2 |
コンパイルメッセージ
Syntax OK
ソースコード
n = gets.to_i ans = 0 [-1,1].repeated_permutation(n*2-1) do |perm| perm.unshift(1) ans += 1 if perm.reduce{|s,e| !s || s < 0 ? nil : s+e} end p ans