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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
280
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
Understanding Apache Lucene - More than just full-text search
spinscale
0
140
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
150
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.4k
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
420
飯MCP
yusukebe
0
390
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.5k
ロボットのための工場に灯りは要らない
watany
12
3.2k
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
240
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
100
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
250
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
240
Navigating Weather and Climate Data
rabernat
0
150
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
160
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.5k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
360
Thoughts on Productivity
jonyablonski
75
5.1k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
Site-Speed That Sticks
csswizardry
13
1.1k
30 Presentation Tips
portentint
PRO
1
260
The World Runs on Bad Software
bkeepers
PRO
72
12k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Are puppies a ranking factor?
jonoalderson
1
3.2k
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 右の写真のように、多摩 動物公園にはオオカミが います。