Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SRM578 解説
Search
tozangezan
May 03, 2013
Programming
0
270
SRM578 解説
tozangezan
May 03, 2013
Tweet
Share
More Decks by tozangezan
See All by tozangezan
SRM573 Div1Hard Div2Hard 解説
tozangezan
1
270
Other Decks in Programming
See All in Programming
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
480
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6.1k
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
210
Oxlintはいいぞ
yug1224
5
1.4k
MUSUBIXとは
nahisaho
0
140
Patterns of Patterns
denyspoltorak
0
1.4k
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
690
Building AI with AI
inesmontani
PRO
1
700
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Between Models and Reality
mayunak
1
190
Code Review Best Practice
trishagee
74
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
Designing Experiences People Love
moore
144
24k
The Curious Case for Waylosing
cassininazir
0
240
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Transcript
SRM 578 Div2 Easy&Hard Div1 Medium 解説 By tozangezan
Div2 Easy (1) これを… N K ret[0]=? ret[1]=?
Div2 Easy (2) こうして… N K ret[0]=max(0,N-K) ret[1]=?
Div2 Easy (3) こうじゃ N K ret[0]=max(0,N-K) ret[1]=N-(K+1)/2
Div2 Hard (1) これを…
Div2 Hard (2) こうして… dp[0] [1] [2] [3] [4] [5]
[6] [7] [8] [9] [10] ... [N+1]
Div2 Hard (3) こうじゃ dp[0] [1] [2] [3] [4] [5]
[6] [7] [8] [9] [10] ... [N+1] dp[3]=dp[0]+dp[1] +dp[2] dp[0]=1 dp[9]=dp[3]+dp[4]+ ...+dp[8] Answer
Div1 Medium (1) これを…
Div1 Medium (2) こうして… dp[last][now]->dp[now][next] (if now->next vaild) At first,
dp[i][j]=1(0<=i<j<=N-1). The answer is (sum of dp[i][j])+N+1
Div1 Medium (2) こうじゃ dp[last][now]->dp[now][next] (if now->next vaild) Valid: interval
[left,right] (left<=last<next<=rig ht) is not exist Calculate valid edge in advance.
The End 右の写真のように、多摩 動物公園にはオオカミが います。