結果
問題 |
No.3141 Balancing with X=>O Flip
|
ユーザー |
![]() |
提出日時 | 2025-05-26 17:50:13 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 301 bytes |
コンパイル時間 | 2,308 ms |
コンパイル使用メモリ | 193,264 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-05-26 17:50:17 |
合計ジャッジ時間 | 3,614 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; string s; cin >> s; int cnt[2] = {}; for (char c : s) { cnt[c == '(']++; } cout << (cnt[0] == cnt[1] ? "Yes" : "No") << '\n'; }