結果
| 問題 | No.3142 Balancing with O=>X Flip |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-04 04:40:53 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 3 ms / 2,000 ms |
| + 415µs | |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 3,007 ms |
| コンパイル使用メモリ | 172,240 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-04 04:41:02 |
| 合計ジャッジ時間 | 4,386 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
int n; string s; cin >> n >> s;
int x=0;
for(auto p:s){
if(p=='(') x++;
else{
if(x==0){
cout << "No" << endl; return 0;
}
x--;
}
}
cout << (x==0?"Yes":"No") << endl;
return 0;
}