SlideShare a Scribd company logo
1 of 11
ICPC Asia::Tokyo 2014 
Problem K – L∞ Jumps
K: L∞ Jumps – Solution (1/4) 
• Sort the given points (x1, y1), …, (xn, yn) in clockwise 
order. Call them base vectors. 
• Suppose we fix jump vectors to (u1, v1), …, (un, vn). 
(u1+…+un = s, v1+…+vn = t) 
• What is the optimal assignment between base 
vectors and jump vectors? 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
→ Greedy is the best 
(u1, v1) 
(u2, v2) 
(u3, v3) 
(u5, v5) 
(u4, v4) 
Base vectors Jump vectors
K: L∞ Jumps – Solution (1/4) 
• Sort the given points (x1, y1), …, (xn, yn) in clockwise 
order. Call them base vectors. 
• Suppose we fix jump vectors to (u1, v1), …, (un, vn). 
(u1+…+un = s, v1+…+vn = t) 
• What is the optimal assignment between base 
vectors and jump vectors? 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
→ Greedy is the best 
(u1, v1) 
(u2, v2) 
(u3, v3) 
(u5, v5) 
(u4, v4) 
Base vectors Jump vectors
K: L∞ Jumps – Solution (1/4) 
• Sort the given points (x1, y1), …, (xn, yn) in clockwise 
order. Call them base vectors. 
• Suppose we fix jump vectors to (u1, v1), …, (un, vn). 
(u1+…+un = s, v1+…+vn = t) 
• What is the optimal assignment between base 
vectors and jump vectors? 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
→ Greedy is the best 
(u1, v1) 
(u2, v2) 
(u3, v3) 
(u5, v5) 
(u4, v4) 
Base vectors Jump vectors
K: L∞ Jumps – Solution (1/4) 
• Sort the given points (x1, y1), …, (xn, yn) in clockwise 
order. Call them base vectors. 
• Suppose we fix jump vectors to (u1, v1), …, (un, vn). 
(u1+…+un = s, v1+…+vn = t) 
• What is the optimal assignment between base 
vectors and jump vectors? 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
→ Greedy is the best 
(u1, v1) 
(u2, v2) 
(u3, v3) 
(u5, v5) 
(u4, v4) 
Base vectors Jump vectors
K: L∞ Jumps – Solution (1/4) 
• Sort the given points (x1, y1), …, (xn, yn) in clockwise 
order. Call them base vectors. 
• Suppose we fix jump vectors to (u1, v1), …, (un, vn). 
(u1+…+un = s, v1+…+vn = t) 
• What is the optimal assignment between base 
vectors and jump vectors? 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
→ Greedy is the best 
(u1, v1) 
(u2, v2) 
(u3, v3) 
(u5, v5) 
(u4, v4) 
Base vectors Jump vectors
K: L∞ Jumps – Solution (1/4) 
• Sort the given points (x1, y1), …, (xn, yn) in clockwise 
order. Call them base vectors. 
• Suppose we fix jump vectors to (u1, v1), …, (un, vn). 
(u1+…+un = s, v1+…+vn = t) 
• What is the optimal assignment between base 
vectors and jump vectors? 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
→ Greedy is the best 
(u1, v1) 
(u2, v2) 
(u3, v3) 
(u5, v5) 
(u4, v4) 
Base vectors Jump vectors
K: L∞ Jumps – Solution (2/4) 
• But how to determine jump vectors? 
• Let’s fix the count of jump vectors in 
(upper/right/bottom/left) part of the square edge. 
• U := count in upper 
R := count in right 
B := count in bottom 
L := count in left 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
U 
L R 
B 
Base vectors Jump vectors
K: L∞ Jumps – Solution (3/4) 
• Let (p1, d), …, (pU, d) := jump vectors in upper, 
(q1, -d), …, (qB, d) := jump vectors in bottom. 
• Since U,R,B,L is fixed, 
p1+…+pU+q1+…+qB – Ld + Rd = s 
must be satisfied. 
• Since greedy assignment is the best, we can 
compute optimal jump vectors (if we fix offset.) 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
U 
L R 
B 
Base vectors Jump vectors
K: L∞ Jumps – Solution (4/4) 
• Complexity? 
• Fix U,R,B,L: Since U+R+B+L=n, there are O(n3) combins. 
• Fix offset for greedy assignment : O(n) ways. 
• Compute the cost for jump vectors : O(n) time. 
• O(n5) time in total. 
(x1, y1) 
(x2, y2) 
(x3, y3) 
(x4, y4) 
(x5, y5) 
U 
L R 
B 
Base vectors Jump vectors
K: L∞ Jumps – Summary 
No submission…

More Related Content

What's hot

Lecture3 linear svm_with_slack
Lecture3 linear svm_with_slackLecture3 linear svm_with_slack
Lecture3 linear svm_with_slackStéphane Canu
 
Calculus II - 26
Calculus II - 26Calculus II - 26
Calculus II - 26David Mao
 
Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...
Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...
Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...Frank Nielsen
 
Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...
Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...
Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...Facultad de Informática UCM
 
From planar maps to spatial topology change in 2d gravity
From planar maps to spatial topology change in 2d gravityFrom planar maps to spatial topology change in 2d gravity
From planar maps to spatial topology change in 2d gravityTimothy Budd
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Matthew Leingang
 
ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-
ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-
ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-ssusere0a682
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithmsSaga Valsalan
 
Cálculo II - Aula 3: Integração por partes
Cálculo II - Aula 3: Integração por partesCálculo II - Aula 3: Integração por partes
Cálculo II - Aula 3: Integração por parteswillianv
 
30 surface integrals
30 surface integrals30 surface integrals
30 surface integralsmath267
 
Mesh Processing Course : Active Contours
Mesh Processing Course : Active ContoursMesh Processing Course : Active Contours
Mesh Processing Course : Active ContoursGabriel Peyré
 
Introduccio al calculo vectorial
Introduccio  al calculo vectorialIntroduccio  al calculo vectorial
Introduccio al calculo vectorialEDESMITCRUZ1
 
Prims & kruskal algorithms
Prims & kruskal algorithmsPrims & kruskal algorithms
Prims & kruskal algorithmsAyesha Tahir
 
C3 Transformations
C3 TransformationsC3 Transformations
C3 TransformationsJJkedst
 
Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...
Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...
Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...Geoffrey Négiar
 
CIVE 572 Final Project
CIVE 572 Final ProjectCIVE 572 Final Project
CIVE 572 Final Projectdanielrobb
 

What's hot (20)

Lecture3 linear svm_with_slack
Lecture3 linear svm_with_slackLecture3 linear svm_with_slack
Lecture3 linear svm_with_slack
 
Calculus II - 26
Calculus II - 26Calculus II - 26
Calculus II - 26
 
Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...
Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...
Slides: Total Jensen divergences: Definition, Properties and k-Means++ Cluste...
 
Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...
Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...
Mi ordenador, de mayor, quiere ser cuántico (curso acelerado de simulación ...
 
From planar maps to spatial topology change in 2d gravity
From planar maps to spatial topology change in 2d gravityFrom planar maps to spatial topology change in 2d gravity
From planar maps to spatial topology change in 2d gravity
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
 
Lecture5 kernel svm
Lecture5 kernel svmLecture5 kernel svm
Lecture5 kernel svm
 
ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-
ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-
ゲーム理論NEXT コア第1回 -特性関数と配分&コアの定義-
 
Prims and kruskal algorithms
Prims and kruskal algorithmsPrims and kruskal algorithms
Prims and kruskal algorithms
 
Cálculo II - Aula 3: Integração por partes
Cálculo II - Aula 3: Integração por partesCálculo II - Aula 3: Integração por partes
Cálculo II - Aula 3: Integração por partes
 
30 surface integrals
30 surface integrals30 surface integrals
30 surface integrals
 
Mesh Processing Course : Active Contours
Mesh Processing Course : Active ContoursMesh Processing Course : Active Contours
Mesh Processing Course : Active Contours
 
Introduccio al calculo vectorial
Introduccio  al calculo vectorialIntroduccio  al calculo vectorial
Introduccio al calculo vectorial
 
Prims & kruskal algorithms
Prims & kruskal algorithmsPrims & kruskal algorithms
Prims & kruskal algorithms
 
C3 Transformations
C3 TransformationsC3 Transformations
C3 Transformations
 
Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...
Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...
Stochastic Frank-Wolfe for Constrained Finite Sum Minimization @ Montreal Opt...
 
Analysis Solutions CVI
Analysis Solutions CVIAnalysis Solutions CVI
Analysis Solutions CVI
 
CIVE 572 Final Project
CIVE 572 Final ProjectCIVE 572 Final Project
CIVE 572 Final Project
 
Lecture6 svdd
Lecture6 svddLecture6 svdd
Lecture6 svdd
 
Pdfcode
PdfcodePdfcode
Pdfcode
 

Similar to ICPC Asia::Tokyo 2014 Problem K – L∞ Jumps

Lec 5 combinational logic k-maps2
Lec 5 combinational logic k-maps2Lec 5 combinational logic k-maps2
Lec 5 combinational logic k-maps2Bassem Hassan
 
Geometry unit 3.7
Geometry unit 3.7Geometry unit 3.7
Geometry unit 3.7Mark Ryder
 
Chapter 5 interpolation
Chapter 5 interpolationChapter 5 interpolation
Chapter 5 interpolationssuser53ee01
 
Chapter 12 Section 12.1 Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1  Three-Dimensional Coordinate SysChapter 12 Section 12.1  Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1 Three-Dimensional Coordinate SysEstelaJeffery653
 
An Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a PolygonAn Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a PolygonKasun Ranga Wijeweera
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgosRoziq Bahtiar
 
An Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a PolygonAn Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a PolygonKasun Ranga Wijeweera
 
Module 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notesModule 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notescauleyc
 
Module 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notesModule 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notesAnnie cox
 
37 more on slopes-x
37 more on slopes-x37 more on slopes-x
37 more on slopes-xmath123a
 

Similar to ICPC Asia::Tokyo 2014 Problem K – L∞ Jumps (20)

Daa chapter7
Daa chapter7Daa chapter7
Daa chapter7
 
Lec 5 combinational logic k-maps2
Lec 5 combinational logic k-maps2Lec 5 combinational logic k-maps2
Lec 5 combinational logic k-maps2
 
58 slopes of lines
58 slopes of lines58 slopes of lines
58 slopes of lines
 
Geometry unit 3.7
Geometry unit 3.7Geometry unit 3.7
Geometry unit 3.7
 
Linear equations 2-2 a graphing and x-y intercepts
Linear equations   2-2 a graphing and x-y interceptsLinear equations   2-2 a graphing and x-y intercepts
Linear equations 2-2 a graphing and x-y intercepts
 
Chapter 5 interpolation
Chapter 5 interpolationChapter 5 interpolation
Chapter 5 interpolation
 
Parabola complete
Parabola completeParabola complete
Parabola complete
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Chapter 12 Section 12.1 Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1  Three-Dimensional Coordinate SysChapter 12 Section 12.1  Three-Dimensional Coordinate Sys
Chapter 12 Section 12.1 Three-Dimensional Coordinate Sys
 
ch16.pptx
ch16.pptxch16.pptx
ch16.pptx
 
ch16 (1).pptx
ch16 (1).pptxch16 (1).pptx
ch16 (1).pptx
 
Dmss2011 public
Dmss2011 publicDmss2011 public
Dmss2011 public
 
An Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a PolygonAn Algorithm to Find the Largest Circle inside a Polygon
An Algorithm to Find the Largest Circle inside a Polygon
 
Open GL 04 linealgos
Open GL 04 linealgosOpen GL 04 linealgos
Open GL 04 linealgos
 
Lecture 2.1 2.2a bt
Lecture 2.1 2.2a btLecture 2.1 2.2a bt
Lecture 2.1 2.2a bt
 
Pc 2.1 notes
Pc 2.1 notesPc 2.1 notes
Pc 2.1 notes
 
An Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a PolygonAn Algorithm to Find the Visible Region of a Polygon
An Algorithm to Find the Visible Region of a Polygon
 
Module 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notesModule 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notes
 
Module 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notesModule 4 topic 1 part 1 notes
Module 4 topic 1 part 1 notes
 
37 more on slopes-x
37 more on slopes-x37 more on slopes-x
37 more on slopes-x
 

More from irrrrr

ICPC 2015, Tsukuba : Unofficial Commentary
ICPC 2015, Tsukuba: Unofficial CommentaryICPC 2015, Tsukuba: Unofficial Commentary
ICPC 2015, Tsukuba : Unofficial Commentaryirrrrr
 
ICML2015読み会:Optimal and Adaptive Algorithms for Online Boosting
ICML2015読み会:Optimal and Adaptive Algorithms for Online BoostingICML2015読み会:Optimal and Adaptive Algorithms for Online Boosting
ICML2015読み会:Optimal and Adaptive Algorithms for Online Boostingirrrrr
 
機械学習とその理論 (情報オリンピック2015春合宿講義資料)
機械学習とその理論 (情報オリンピック2015春合宿講義資料)機械学習とその理論 (情報オリンピック2015春合宿講義資料)
機械学習とその理論 (情報オリンピック2015春合宿講義資料)irrrrr
 
論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth
論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth
論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidthirrrrr
 
ICPC Asia::Tokyo 2014 Problem J – Exhibition
ICPC Asia::Tokyo 2014 Problem J – ExhibitionICPC Asia::Tokyo 2014 Problem J – Exhibition
ICPC Asia::Tokyo 2014 Problem J – Exhibitionirrrrr
 
ICALP 2014 参加記
ICALP 2014 参加記ICALP 2014 参加記
ICALP 2014 参加記irrrrr
 
Testing Forest-Isomorphism in the Adjacency List Model
Testing Forest-Isomorphismin the Adjacency List ModelTesting Forest-Isomorphismin the Adjacency List Model
Testing Forest-Isomorphism in the Adjacency List Modelirrrrr
 
スペクトラルグラフ理論入門
スペクトラルグラフ理論入門スペクトラルグラフ理論入門
スペクトラルグラフ理論入門irrrrr
 
Soul Gem Game
Soul Gem GameSoul Gem Game
Soul Gem Gameirrrrr
 

More from irrrrr (9)

ICPC 2015, Tsukuba : Unofficial Commentary
ICPC 2015, Tsukuba: Unofficial CommentaryICPC 2015, Tsukuba: Unofficial Commentary
ICPC 2015, Tsukuba : Unofficial Commentary
 
ICML2015読み会:Optimal and Adaptive Algorithms for Online Boosting
ICML2015読み会:Optimal and Adaptive Algorithms for Online BoostingICML2015読み会:Optimal and Adaptive Algorithms for Online Boosting
ICML2015読み会:Optimal and Adaptive Algorithms for Online Boosting
 
機械学習とその理論 (情報オリンピック2015春合宿講義資料)
機械学習とその理論 (情報オリンピック2015春合宿講義資料)機械学習とその理論 (情報オリンピック2015春合宿講義資料)
機械学習とその理論 (情報オリンピック2015春合宿講義資料)
 
論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth
論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth
論文紹介 Advances in Learning Bayesian Networks of Bounded Treewidth
 
ICPC Asia::Tokyo 2014 Problem J – Exhibition
ICPC Asia::Tokyo 2014 Problem J – ExhibitionICPC Asia::Tokyo 2014 Problem J – Exhibition
ICPC Asia::Tokyo 2014 Problem J – Exhibition
 
ICALP 2014 参加記
ICALP 2014 参加記ICALP 2014 参加記
ICALP 2014 参加記
 
Testing Forest-Isomorphism in the Adjacency List Model
Testing Forest-Isomorphismin the Adjacency List ModelTesting Forest-Isomorphismin the Adjacency List Model
Testing Forest-Isomorphism in the Adjacency List Model
 
スペクトラルグラフ理論入門
スペクトラルグラフ理論入門スペクトラルグラフ理論入門
スペクトラルグラフ理論入門
 
Soul Gem Game
Soul Gem GameSoul Gem Game
Soul Gem Game
 

Recently uploaded

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

ICPC Asia::Tokyo 2014 Problem K – L∞ Jumps

  • 1. ICPC Asia::Tokyo 2014 Problem K – L∞ Jumps
  • 2. K: L∞ Jumps – Solution (1/4) • Sort the given points (x1, y1), …, (xn, yn) in clockwise order. Call them base vectors. • Suppose we fix jump vectors to (u1, v1), …, (un, vn). (u1+…+un = s, v1+…+vn = t) • What is the optimal assignment between base vectors and jump vectors? (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) → Greedy is the best (u1, v1) (u2, v2) (u3, v3) (u5, v5) (u4, v4) Base vectors Jump vectors
  • 3. K: L∞ Jumps – Solution (1/4) • Sort the given points (x1, y1), …, (xn, yn) in clockwise order. Call them base vectors. • Suppose we fix jump vectors to (u1, v1), …, (un, vn). (u1+…+un = s, v1+…+vn = t) • What is the optimal assignment between base vectors and jump vectors? (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) → Greedy is the best (u1, v1) (u2, v2) (u3, v3) (u5, v5) (u4, v4) Base vectors Jump vectors
  • 4. K: L∞ Jumps – Solution (1/4) • Sort the given points (x1, y1), …, (xn, yn) in clockwise order. Call them base vectors. • Suppose we fix jump vectors to (u1, v1), …, (un, vn). (u1+…+un = s, v1+…+vn = t) • What is the optimal assignment between base vectors and jump vectors? (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) → Greedy is the best (u1, v1) (u2, v2) (u3, v3) (u5, v5) (u4, v4) Base vectors Jump vectors
  • 5. K: L∞ Jumps – Solution (1/4) • Sort the given points (x1, y1), …, (xn, yn) in clockwise order. Call them base vectors. • Suppose we fix jump vectors to (u1, v1), …, (un, vn). (u1+…+un = s, v1+…+vn = t) • What is the optimal assignment between base vectors and jump vectors? (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) → Greedy is the best (u1, v1) (u2, v2) (u3, v3) (u5, v5) (u4, v4) Base vectors Jump vectors
  • 6. K: L∞ Jumps – Solution (1/4) • Sort the given points (x1, y1), …, (xn, yn) in clockwise order. Call them base vectors. • Suppose we fix jump vectors to (u1, v1), …, (un, vn). (u1+…+un = s, v1+…+vn = t) • What is the optimal assignment between base vectors and jump vectors? (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) → Greedy is the best (u1, v1) (u2, v2) (u3, v3) (u5, v5) (u4, v4) Base vectors Jump vectors
  • 7. K: L∞ Jumps – Solution (1/4) • Sort the given points (x1, y1), …, (xn, yn) in clockwise order. Call them base vectors. • Suppose we fix jump vectors to (u1, v1), …, (un, vn). (u1+…+un = s, v1+…+vn = t) • What is the optimal assignment between base vectors and jump vectors? (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) → Greedy is the best (u1, v1) (u2, v2) (u3, v3) (u5, v5) (u4, v4) Base vectors Jump vectors
  • 8. K: L∞ Jumps – Solution (2/4) • But how to determine jump vectors? • Let’s fix the count of jump vectors in (upper/right/bottom/left) part of the square edge. • U := count in upper R := count in right B := count in bottom L := count in left (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) U L R B Base vectors Jump vectors
  • 9. K: L∞ Jumps – Solution (3/4) • Let (p1, d), …, (pU, d) := jump vectors in upper, (q1, -d), …, (qB, d) := jump vectors in bottom. • Since U,R,B,L is fixed, p1+…+pU+q1+…+qB – Ld + Rd = s must be satisfied. • Since greedy assignment is the best, we can compute optimal jump vectors (if we fix offset.) (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) U L R B Base vectors Jump vectors
  • 10. K: L∞ Jumps – Solution (4/4) • Complexity? • Fix U,R,B,L: Since U+R+B+L=n, there are O(n3) combins. • Fix offset for greedy assignment : O(n) ways. • Compute the cost for jump vectors : O(n) time. • O(n5) time in total. (x1, y1) (x2, y2) (x3, y3) (x4, y4) (x5, y5) U L R B Base vectors Jump vectors
  • 11. K: L∞ Jumps – Summary No submission…