結果
問題 | No.3141 Balancing with X=>O Flip |
ユーザー |
![]() |
提出日時 | 2025-05-16 21:25:11 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 249 bytes |
コンパイル時間 | 718 ms |
コンパイル使用メモリ | 99,716 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-05-17 03:13:19 |
合計ジャッジ時間 | 1,615 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int cnt = 0; for (auto c : s) cnt += (c == '(' ? 1 : -1); cout << (cnt == 0 ? "Yes" : "No") << endl; }