結果

問題 No.3142 Balancing with O=>X Flip
ユーザー Blue_S
提出日時 2025-05-16 21:28:40
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 446 bytes
コンパイル時間 24,627 ms
コンパイル使用メモリ 391,340 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-05-16 23:53:18
合計ジャッジ時間 13,269 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: type alias `Map` is never used
 --> src/main.rs:5:6
  |
5 | type Map<K, V> = BTreeMap<K, V>;
  |      ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: type alias `Set` is never used
 --> src/main.rs:6:6
  |
6 | type Set<T> = BTreeSet<T>;
  |      ^^^

warning: type alias `Deque` is never used
 --> src/main.rs:7:6
  |
7 | type Deque<T> = VecDeque<T>;
  |      ^^^^^

warning: type alias `Heap` is never used
 --> src/main.rs:8:6
  |
8 | type Heap<T> = BinaryHeap<T>;
  |      ^^^^

warning: constant `MOD` is never used
  --> src/main.rs:10:7
   |
10 | const MOD: u64 = 998_244_353;
   |       ^^^

ソースコード

diff #

use proconio::marker::*;
use proconio::*;
use std::collections::*;

type Map<K, V> = BTreeMap<K, V>;
type Set<T> = BTreeSet<T>;
type Deque<T> = VecDeque<T>;
type Heap<T> = BinaryHeap<T>;

const MOD: u64 = 998_244_353;

fn main() {
    input! {
        n: usize,
        s: Bytes,
    }

    if n & 1 == 0 && s.iter().filter(|c| **c == b'(').count() == n / 2 && s[0] != b')' {
        println!("Yes");
    } else {
        println!("No");
    }
}
0