Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AtCoder Beginner Contest 091 C - 2D Plane 2N Po...
Search
Ichijyo
January 10, 2019
Technology
510
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AtCoder Beginner Contest 091 C - 2D Plane 2N Points 非公式解説
Ichijyo
January 10, 2019
Other Decks in Technology
See All in Technology
アウトプット初心者、半年間のふりかえり
4o1sobblue
0
440
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
290
パッチ更新でterraform initが落ちた日
grimoh
1
140
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
PagerDuty Tech Hub-鳴らすけれど、人は動かない
ezaki
0
180
Gemini Intelligence 入門 ― AppFunctions と Gemini Nano
takuroabe
0
290
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
130
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
310
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
160
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
3
600
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
180
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Curious Case for Waylosing
cassininazir
1
570
Side Projects
sachag
456
43k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Automating Front-end Workflow
addyosmani
1369
210k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
AtCoder Beginner Contest 091 C - 2D Plane 2N Points
非公式解説 @Ichijyo_piyo
問題概要 ・赤い点の座標が 1 , 1 , 2 , 2 ,
… , , で,青い点の座 標が 1 , 1 , 2 , 2 , … , , で与えられる. ・赤・青のペアをできるだけ多く作る. ・ペアになれる条件は,赤い点が青い点の左下に位置してい ることである. 1
解法の概要 ~入力例4~ 解法1:公式解説に書かれてい る方法(貪欲法) 解法2:二部グラフの最大マッ チング問題として考える(公式 解説中の“余談”) 本スライドでは“解法1”を説明す る. 2
解説(1/8) ~入力例4~ • 青い点のうち,最も座標が小 さいもの(bAとする)に注目 する. • bAはペアになれる赤い点が存 在した場合,最も座標が大き いもの(rAとする)とペアにす
ればよい.(証明は略) bA rA × この点はbAとは ペアになれません 3
解説(2/8) ~入力例4~ 青い点を座標の小さい順に見ていく • 青い点より左下にある,まだペア になっていない赤い点を探す. (なかったらなにもしない) • あったら,その中で最も最も座 標が大きいものを探し,ペアにす
る. ペア 4
解説(3/8) ~入力例4~ 青い点を座標の小さい順に見ていく • ペア1:青(3, 7)-赤(1, 6) 1 5
解説(4/8) ~入力例4~ 青い点を座標の小さい順に見ていく • ペア1:青(3, 7)-赤(1, 6) • ペア2:青(5, 4)-赤(1,
6) 1 2 6
解説(5/8) ~入力例4~ 青い点を座標の小さい順に見ていく • ペア1:青(3, 7)-赤(1, 6) • ペア2:青(5, 4)-赤(1,
6) • ペア3:青(6, 9)-赤(4, 8) 1 2 3 7
解説(6/8) ~入力例4~ 青い点を座標の小さい順に見ていく • ペア1:青(3, 7)-赤(1, 6) • ペア2:青(5, 4)-赤(1,
6) • ペア3:青(6, 9)-赤(4, 8) • ペア4:青(8, 5)-赤(7, 3) 1 2 3 4 8
解説(7/8) ~入力例4~ 青い点を座標の小さい順に見ていく • ペア1:青(3, 7)-赤(1, 6) • ペア2:青(5, 4)-赤(1,
6) • ペア3:青(6, 9)-赤(4, 8) • ペア4:青(8, 5)-赤(7, 3) • ペア5:青(9, 1)-赤(0, 0) 1 2 3 5 9 4
解説(8/8) ~入力例4~ • ペア1:青(3, 7)-赤(1, 6) • ペア2:青(5, 4)-赤(1, 6)
• ペア3:青(6, 9)-赤(4, 8) • ペア4:青(8, 5)-赤(7, 3) • ペア5:青(9, 1)-赤(0, 0) よって,5通り 1 2 3 5 10 4
参考資料 ・Kohei Morita(yosupo),「ARC 091/ABC 090 解説」, <https://img.atcoder.jp/arc092/editorial.pdf> 11