結果
| 問題 |
No.790 ちきんの括弧並べ
|
| ユーザー |
|
| 提出日時 | 2019-05-20 04:33:09 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 433 bytes |
| コンパイル時間 | 2,214 ms |
| コンパイル使用メモリ | 61,064 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 01:36:12 |
| 合計ジャッジ時間 | 3,176 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils
proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" ,discardable.}
proc scan(): int =
while true:
let k = getchar_unlocked()
if k < '0': return
result = 10 * result + k.ord - '0'.ord
let n = scan()
proc solve(x,y:int):int = # x:( , y:)
if x == n and y == n : return 1
if x > n or y > n : return 0
if x < y : return 0
return solve(x+1,y) + solve(x,y+1)
echo solve(0,0)