結果
問題 |
No.3141 Balancing with X=>O Flip
|
ユーザー |
![]() |
提出日時 | 2025-07-22 14:39:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 389 bytes |
コンパイル時間 | 2,776 ms |
コンパイル使用メモリ | 275,524 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-07-22 14:39:48 |
合計ジャッジ時間 | 4,374 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N >> S; int l = 0; int r = 0; for (int i = 0; i < N; i++) { if (S[i] == '(') { l++; } else { r++; } } if (l == r) { cout << "Yes\n"; } else { cout << "No\n"; } }