結果
問題 |
No.3210 Fixed Sign Sequense
|
ユーザー |
![]() |
提出日時 | 2025-07-31 00:39:43 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 333 ms / 2,000 ms |
コード長 | 324 bytes |
コンパイル時間 | 14,829 ms |
コンパイル使用メモリ | 242,144 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-07-31 00:40:09 |
合計ジャッジ時間 | 25,545 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
package main import . "fmt" import . "strings" func main() { var n,s string Scan(&n,&s) plus := Count(s, "+") ans := plus minus := 0 for _, c := range s { switch c { case '+': plus-- case '-': minus++ ans = max(ans, minus+plus) case '0': ans = max(ans, minus+1+plus) } } Println(ans) }