結果
| 問題 |
No.3142 Balancing with O=>X Flip
|
| コンテスト | |
| ユーザー |
ID 21712
|
| 提出日時 | 2025-05-17 00:15:01 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 119 ms / 2,000 ms |
| コード長 | 302 bytes |
| コンパイル時間 | 12,774 ms |
| コンパイル使用メモリ | 247,452 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2025-05-17 00:15:16 |
| 合計ジャッジ時間 | 14,061 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
package main
import . "fmt"
func main() {
var n,s string
Scan(&n,&s)
// 解説読んだでしょう
// 理屈難しい
x:=0
for _,c:=range s{
if c=='(' {
x++
} else {
x--
if x<0 {
Println("No")
return
}
}
}
if x==0 {
Println("Yes")
} else {
Println("No")
}
}
ID 21712