Submit Search
Upload
Paren
•
0 likes
•
427 views
O
oupc
Follow
Report
Share
Report
Share
1 of 5
Download now
Download to read offline
Recommended
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表
Kazuma Mikami
暫定
K2PC Div1 E 暗号化
K2PC Div1 E 暗号化
Kazuma Mikami
Segpair
Segpair
oupc
Rmq
Rmq
oupc
Magical
Magical
oupc
Permutation
Permutation
oupc
One
One
oupc
Cube
Cube
oupc
Recommended
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表
Kazuma Mikami
暫定
K2PC Div1 E 暗号化
K2PC Div1 E 暗号化
Kazuma Mikami
Segpair
Segpair
oupc
Rmq
Rmq
oupc
Magical
Magical
oupc
Permutation
Permutation
oupc
One
One
oupc
Cube
Cube
oupc
Sort
Sort
oupc
Gcd
Gcd
oupc
Comment
Comment
oupc
Trip
Trip
oupc
1
1
oupc
Replace
Replace
oupc
Kth
Kth
oupc
Goto
Goto
oupc
Palin
Palin
oupc
Sharp2sat
Sharp2sat
oupc
Sanpo
Sanpo
oupc
指数時間アルゴリズム入門
指数時間アルゴリズム入門
Yoichi Iwata
情オリ2012春合宿講義資料
Knapsack
Knapsack
oupc
Game
Game
oupc
Four op
Four op
oupc
Divisor
Divisor
oupc
Division
Division
oupc
Anagram
Anagram
oupc
A
A
oupc
Comment
Comment
oupc
More Related Content
Viewers also liked
Sort
Sort
oupc
Gcd
Gcd
oupc
Comment
Comment
oupc
Trip
Trip
oupc
1
1
oupc
Replace
Replace
oupc
Kth
Kth
oupc
Goto
Goto
oupc
Palin
Palin
oupc
Sharp2sat
Sharp2sat
oupc
Sanpo
Sanpo
oupc
指数時間アルゴリズム入門
指数時間アルゴリズム入門
Yoichi Iwata
情オリ2012春合宿講義資料
Viewers also liked
(12)
Sort
Sort
Gcd
Gcd
Comment
Comment
Trip
Trip
1
1
Replace
Replace
Kth
Kth
Goto
Goto
Palin
Palin
Sharp2sat
Sharp2sat
Sanpo
Sanpo
指数時間アルゴリズム入門
指数時間アルゴリズム入門
More from oupc
Knapsack
Knapsack
oupc
Game
Game
oupc
Four op
Four op
oupc
Divisor
Divisor
oupc
Division
Division
oupc
Anagram
Anagram
oupc
A
A
oupc
Comment
Comment
oupc
More from oupc
(8)
Knapsack
Knapsack
Game
Game
Four op
Four op
Divisor
Divisor
Division
Division
Anagram
Anagram
A
A
Comment
Comment
Paren
1.
() 原案:komiya 解答:komiya, lyoz
解説:lyoz
2.
問題概要 文字列𝑆がある(初期状態では空) 𝑆に次の操作を𝑛回適用する
末尾に ’(’ を𝑥 𝑖 個追加 末尾に ’)’ を𝑥 𝑖 個追加 最終的な𝑆は,括弧の対応がとれているか? 制約 1 ≤ 𝑛 ≤ 1,000 1 ≤ 𝑥 𝑖 ≤ 10^6
3.
誤解法 括弧をすべて展開して1文字ずつ処理
𝑂(∑𝑥 𝑖 ) TLE or MLE (括弧,個数)のままスタック操作 ’)’が来たら,スタックから必要なだけpop これでも解けるがちょっと面倒
4.
解法 閉じられずに余っている ’(’
の個数を𝑝とする ’(’ が来たら,𝑝に𝑥 𝑖 を足す ’)’ が来たら,𝑝から𝑥 𝑖 を引く 途中で𝑝 < 0とならず,最後に𝑝 = 0であればOK
5.
提出状況 AC Rate
65.63% (42/64) First Acceptance Onsite: password (5 min) All: password (5 min)
Download now