結果
問題 | No.457 (^^*) |
ユーザー |
|
提出日時 | 2019-01-20 20:40:26 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 573 bytes |
コンパイル時間 | 2,318 ms |
コンパイル使用メモリ | 61,268 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 10:26:37 |
合計ジャッジ時間 | 3,186 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import sequtils proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .} # (((*((^^*))))) var x = newSeqWith(5,0) # ( * ^ ^ を満たした数 var y = newSeqWith(5,0) # ( ^ ^ *を満たした数 while true: let c = getchar_unlocked() if c == '(': x[0] += 1 y[0] += 1 elif c == '^': x[3] += x[2] x[2] = x[1] x[1] = 0 y[2] += y[1] y[1] = y[0] y[0] = 0 elif c == '*': x[1] += x[0] x[0] = 0 y[3] += y[2] y[2] = 0 elif c == ')': x[4] += x[3] y[4] += y[3] else: break echo y[4]," ",x[4]