SlideShare a Scribd company logo
Codeforces Round #299
<Tavas and Pashmaks>
Minsu Kim
Description
• Given a set of competitors which have 𝑟𝑖 and 𝑠𝑖 as its value,
find the largest subset of possible winners W
• a competitor can be a winner if there exists 𝑅, 𝑆 ∈ ℝ+
2
where 𝑡 =
𝑅
𝑟 𝑖
+
𝑆
𝑠 𝑖
has the minimum value in the set.
• Constraints : 1 ≤ 𝑛 ≤ 2 × 105, 1 ≤ 𝑠𝑖, 𝑟𝑖 ≤ 104
Obvious Facts
• A competitor 𝑖 cannot be a winner if another competitor 𝑗
such that 𝑟𝑖 < 𝑟𝑗 𝑎𝑛𝑑 𝑠𝑖 < 𝑠𝑗 exists.
𝑟
𝑠
(𝑟𝑗, 𝑠𝑗)
(𝑟𝑖, 𝑠𝑖)
Geometric Analysis
• 𝑡 should be the minimum for 𝑖 to be a winner
• min 𝑡 =
𝑅
𝑟 𝑖
+
𝑆
𝑠 𝑖
= R, S ∙
1
𝑟 𝑖
,
1
𝑠 𝑖
= R, S × |
1
𝑟 𝑖
,
1
𝑠 𝑖
| × cos 𝜃
• Boxed one is the component of
𝟏
𝒓 𝒊
,
𝟏
𝒔 𝒊
in dir. of 𝐑, 𝐒
• Therefore, suppose R, S is any unit vector in the first
quadrant and find the possible winners!
Geometric Analysis
1
𝑟
1
𝑠
(𝑅, 𝑆)
Winners!
Geometric Analysis
1
𝑟
1
𝑠
(𝑅, 𝑆)
Winners!
Geometric Analysis
1
𝑟
1
𝑠
(𝑅, 𝑆)
Winners!
Insight
• Winners turned out to be..
the subset of Convex Hull for the points
1
𝑟 𝑖
,
1
𝑠 𝑖
!
• Exactly, the lower-left part of the Convex Hull.
Implementation
• There are some pesky things in implementation..
1. Precision Problem : repeated cross production of fractions
• Use integers.
• 𝑓𝑜𝑟 𝑃
1
𝑝 𝑥
,
1
𝑝 𝑦
, 𝐴
1
𝑎 𝑥
,
1
𝑎 𝑦
, 𝐵
1
𝑏 𝑥
,
1
𝑏 𝑦
, 𝑐ℎ𝑒𝑐𝑘𝑖𝑛𝑔 𝑐𝑜𝑢𝑛𝑡𝑒𝑟 − 𝑐𝑙𝑜𝑐𝑘𝑤𝑖𝑠𝑒 𝑤𝑖𝑙𝑙 𝑏𝑒
• 𝐴 − 𝑃 × 𝐵 − 𝑃 =
(𝑝 𝑥−𝑎 𝑥)(𝑝 𝑦−𝑏 𝑦)
𝑎 𝑥 𝑏 𝑦 𝑝 𝑥 𝑝 𝑦
−
𝑝 𝑦−𝑎 𝑦 𝑝 𝑥−𝑏 𝑥
𝑎 𝑦 𝑏 𝑥 𝑝 𝑥 𝑝 𝑦
> 0
⇔ 𝑎 𝑦 𝑏 𝑥 𝑝 𝑥 − 𝑎 𝑥 𝑝 𝑦 − 𝑏 𝑦 − 𝑎 𝑥 𝑏 𝑦 𝑝 𝑦 − 𝑎 𝑦 𝑝 𝑥 − 𝑏 𝑥 > 0
2. Duplicated Competitors : vary for the Convex Hull algorithm
• Regard as one and check it later

More Related Content

What's hot

On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
IJMER
 
Differentiation
Differentiation Differentiation
Differentiation
EFREN ARCHIDE
 
Taller 1 parcial 3
Taller 1 parcial 3Taller 1 parcial 3
Taller 1 parcial 3
katherinecedeo11
 
A uniform distribution has density function find n (1)
A uniform distribution has density function find n (1)A uniform distribution has density function find n (1)
A uniform distribution has density function find n (1)
Nadeem Uddin
 
Linear sort
Linear sortLinear sort
Linear sort
Amit Kumar Rathi
 
Mechanics engineering statics forces analysis 3D
Mechanics engineering statics forces analysis 3DMechanics engineering statics forces analysis 3D
Mechanics engineering statics forces analysis 3D
Mohammed8712
 
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
Masahiro Okano
 
Piii taller transformaciones lineales
Piii taller transformaciones linealesPiii taller transformaciones lineales
Piii taller transformaciones lineales
JHANDRYALCIVARGUAJAL
 
Properties of coefficient of correlation
Properties of coefficient of correlationProperties of coefficient of correlation
Properties of coefficient of correlation
Nadeem Uddin
 
Length contraction - Special Relativity
Length contraction - Special RelativityLength contraction - Special Relativity
Length contraction - Special Relativity
Atul Bhat
 
The derivatives module03
The derivatives module03The derivatives module03
The derivatives module03
REYEMMANUELILUMBA
 
Z transforms
Z transformsZ transforms
Z transforms
sujathavvv
 
taller transformaciones lineales
taller transformaciones linealestaller transformaciones lineales
taller transformaciones lineales
emojose107
 
Gcse Maths Resources
Gcse Maths ResourcesGcse Maths Resources
Gcse Maths Resources
LiveOnlineClassesInd
 
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
IJMER
 
Module9 the pearson correlation
Module9 the pearson correlationModule9 the pearson correlation
Module9 the pearson correlation
REYEMMANUELILUMBA
 
6 28 18_hack_hunterdon_meetup_deep_rl
6 28 18_hack_hunterdon_meetup_deep_rl6 28 18_hack_hunterdon_meetup_deep_rl
6 28 18_hack_hunterdon_meetup_deep_rl
Sean Devlin
 
Integral calculus
Integral calculusIntegral calculus
Integral calculus
Farzad Javidanrad
 
Tugas Aljabar Linear
Tugas Aljabar LinearTugas Aljabar Linear
Tugas Aljabar Linear
Nurkhalifah Anwar
 
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
IJMER
 

What's hot (20)

On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
 
Differentiation
Differentiation Differentiation
Differentiation
 
Taller 1 parcial 3
Taller 1 parcial 3Taller 1 parcial 3
Taller 1 parcial 3
 
A uniform distribution has density function find n (1)
A uniform distribution has density function find n (1)A uniform distribution has density function find n (1)
A uniform distribution has density function find n (1)
 
Linear sort
Linear sortLinear sort
Linear sort
 
Mechanics engineering statics forces analysis 3D
Mechanics engineering statics forces analysis 3DMechanics engineering statics forces analysis 3D
Mechanics engineering statics forces analysis 3D
 
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
 
Piii taller transformaciones lineales
Piii taller transformaciones linealesPiii taller transformaciones lineales
Piii taller transformaciones lineales
 
Properties of coefficient of correlation
Properties of coefficient of correlationProperties of coefficient of correlation
Properties of coefficient of correlation
 
Length contraction - Special Relativity
Length contraction - Special RelativityLength contraction - Special Relativity
Length contraction - Special Relativity
 
The derivatives module03
The derivatives module03The derivatives module03
The derivatives module03
 
Z transforms
Z transformsZ transforms
Z transforms
 
taller transformaciones lineales
taller transformaciones linealestaller transformaciones lineales
taller transformaciones lineales
 
Gcse Maths Resources
Gcse Maths ResourcesGcse Maths Resources
Gcse Maths Resources
 
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
 
Module9 the pearson correlation
Module9 the pearson correlationModule9 the pearson correlation
Module9 the pearson correlation
 
6 28 18_hack_hunterdon_meetup_deep_rl
6 28 18_hack_hunterdon_meetup_deep_rl6 28 18_hack_hunterdon_meetup_deep_rl
6 28 18_hack_hunterdon_meetup_deep_rl
 
Integral calculus
Integral calculusIntegral calculus
Integral calculus
 
Tugas Aljabar Linear
Tugas Aljabar LinearTugas Aljabar Linear
Tugas Aljabar Linear
 
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
On ranges and null spaces of a special type of operator named 𝝀 − 𝒋𝒆𝒄𝒕𝒊𝒐𝒏. – ...
 

Similar to Tavas and pashmaks

Optimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsOptimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methods
SantiagoGarridoBulln
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methods
SantiagoGarridoBulln
 
Vehicle Routing Problem using PSO (Particle Swarm Optimization)
Vehicle Routing Problem using PSO (Particle Swarm Optimization)Vehicle Routing Problem using PSO (Particle Swarm Optimization)
Vehicle Routing Problem using PSO (Particle Swarm Optimization)
Niharika Varshney
 
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]
Asafak Husain
 
Max flows via electrical flows (long talk)
Max flows via electrical flows (long talk)Max flows via electrical flows (long talk)
Max flows via electrical flows (long talk)
Thatchaphol Saranurak
 
Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!
ChenYiHuang5
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machines
Jinho Lee
 
Lec05.pptx
Lec05.pptxLec05.pptx
Lec05.pptx
HassanAhmad442087
 
Applied Algorithms and Structures week999
Applied Algorithms and Structures week999Applied Algorithms and Structures week999
Applied Algorithms and Structures week999
fashiontrendzz20
 
LINEAR ALGEBRA, WITH OPTIMIZATION
LINEAR ALGEBRA, WITH OPTIMIZATIONLINEAR ALGEBRA, WITH OPTIMIZATION
LINEAR ALGEBRA, WITH OPTIMIZATION
CHARAK RAY
 
Page rank - from theory to application
Page rank - from theory to applicationPage rank - from theory to application
Page rank - from theory to application
GAYO3
 
Lecture_10_SVD.pptx
Lecture_10_SVD.pptxLecture_10_SVD.pptx
Lecture_10_SVD.pptx
avulodttlrjhycmbmc
 
Quadratic form and functional optimization
Quadratic form and functional optimizationQuadratic form and functional optimization
Quadratic form and functional optimization
Junpei Tsuji
 
2Multi_armed_bandits.pptx
2Multi_armed_bandits.pptx2Multi_armed_bandits.pptx
2Multi_armed_bandits.pptx
ZhiwuGuo1
 
Rational function 11
Rational function 11Rational function 11
Rational function 11
AjayQuines
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logic
Yamagata Yoriyuki
 
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Solving Poisson Equation using Conjugate Gradient Methodand its implementationSolving Poisson Equation using Conjugate Gradient Methodand its implementation
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Jongsu "Liam" Kim
 
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural NetworksPaper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
ChenYiHuang5
 
DL_lecture3_regularization_I.pdf
DL_lecture3_regularization_I.pdfDL_lecture3_regularization_I.pdf
DL_lecture3_regularization_I.pdf
sagayalavanya2
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
ssuser01e301
 

Similar to Tavas and pashmaks (20)

Optimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methodsOptimum engineering design - Day 5. Clasical optimization methods
Optimum engineering design - Day 5. Clasical optimization methods
 
Optimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methodsOptimum Engineering Design - Day 2b. Classical Optimization methods
Optimum Engineering Design - Day 2b. Classical Optimization methods
 
Vehicle Routing Problem using PSO (Particle Swarm Optimization)
Vehicle Routing Problem using PSO (Particle Swarm Optimization)Vehicle Routing Problem using PSO (Particle Swarm Optimization)
Vehicle Routing Problem using PSO (Particle Swarm Optimization)
 
Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]Mathematics of nyquist plot [autosaved] [autosaved]
Mathematics of nyquist plot [autosaved] [autosaved]
 
Max flows via electrical flows (long talk)
Max flows via electrical flows (long talk)Max flows via electrical flows (long talk)
Max flows via electrical flows (long talk)
 
Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!Paper study: Attention, learn to solve routing problems!
Paper study: Attention, learn to solve routing problems!
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machines
 
Lec05.pptx
Lec05.pptxLec05.pptx
Lec05.pptx
 
Applied Algorithms and Structures week999
Applied Algorithms and Structures week999Applied Algorithms and Structures week999
Applied Algorithms and Structures week999
 
LINEAR ALGEBRA, WITH OPTIMIZATION
LINEAR ALGEBRA, WITH OPTIMIZATIONLINEAR ALGEBRA, WITH OPTIMIZATION
LINEAR ALGEBRA, WITH OPTIMIZATION
 
Page rank - from theory to application
Page rank - from theory to applicationPage rank - from theory to application
Page rank - from theory to application
 
Lecture_10_SVD.pptx
Lecture_10_SVD.pptxLecture_10_SVD.pptx
Lecture_10_SVD.pptx
 
Quadratic form and functional optimization
Quadratic form and functional optimizationQuadratic form and functional optimization
Quadratic form and functional optimization
 
2Multi_armed_bandits.pptx
2Multi_armed_bandits.pptx2Multi_armed_bandits.pptx
2Multi_armed_bandits.pptx
 
Rational function 11
Rational function 11Rational function 11
Rational function 11
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logic
 
Solving Poisson Equation using Conjugate Gradient Method and its implementation
Solving Poisson Equation using Conjugate Gradient Methodand its implementationSolving Poisson Equation using Conjugate Gradient Methodand its implementation
Solving Poisson Equation using Conjugate Gradient Method and its implementation
 
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural NetworksPaper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
Paper Study: OptNet: Differentiable Optimization as a Layer in Neural Networks
 
DL_lecture3_regularization_I.pdf
DL_lecture3_regularization_I.pdfDL_lecture3_regularization_I.pdf
DL_lecture3_regularization_I.pdf
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 

Recently uploaded

Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
Lubi Valves
 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
drshikhapandey2022
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
shubhamsaraswat8740
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Massimo Talia
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
wafawafa52
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 

Recently uploaded (20)

Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
 
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUESAN INTRODUCTION OF AI & SEARCHING TECHIQUES
AN INTRODUCTION OF AI & SEARCHING TECHIQUES
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
Digital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes completeDigital Image Processing Unit -2 Notes complete
Digital Image Processing Unit -2 Notes complete
 
An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Levelised Cost of Hydrogen (LCOH) Calculator Manual
Levelised Cost of Hydrogen  (LCOH) Calculator ManualLevelised Cost of Hydrogen  (LCOH) Calculator Manual
Levelised Cost of Hydrogen (LCOH) Calculator Manual
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 

Tavas and pashmaks

  • 1. Codeforces Round #299 <Tavas and Pashmaks> Minsu Kim
  • 2. Description • Given a set of competitors which have 𝑟𝑖 and 𝑠𝑖 as its value, find the largest subset of possible winners W • a competitor can be a winner if there exists 𝑅, 𝑆 ∈ ℝ+ 2 where 𝑡 = 𝑅 𝑟 𝑖 + 𝑆 𝑠 𝑖 has the minimum value in the set. • Constraints : 1 ≤ 𝑛 ≤ 2 × 105, 1 ≤ 𝑠𝑖, 𝑟𝑖 ≤ 104
  • 3. Obvious Facts • A competitor 𝑖 cannot be a winner if another competitor 𝑗 such that 𝑟𝑖 < 𝑟𝑗 𝑎𝑛𝑑 𝑠𝑖 < 𝑠𝑗 exists. 𝑟 𝑠 (𝑟𝑗, 𝑠𝑗) (𝑟𝑖, 𝑠𝑖)
  • 4. Geometric Analysis • 𝑡 should be the minimum for 𝑖 to be a winner • min 𝑡 = 𝑅 𝑟 𝑖 + 𝑆 𝑠 𝑖 = R, S ∙ 1 𝑟 𝑖 , 1 𝑠 𝑖 = R, S × | 1 𝑟 𝑖 , 1 𝑠 𝑖 | × cos 𝜃 • Boxed one is the component of 𝟏 𝒓 𝒊 , 𝟏 𝒔 𝒊 in dir. of 𝐑, 𝐒 • Therefore, suppose R, S is any unit vector in the first quadrant and find the possible winners!
  • 8. Insight • Winners turned out to be.. the subset of Convex Hull for the points 1 𝑟 𝑖 , 1 𝑠 𝑖 ! • Exactly, the lower-left part of the Convex Hull.
  • 9. Implementation • There are some pesky things in implementation.. 1. Precision Problem : repeated cross production of fractions • Use integers. • 𝑓𝑜𝑟 𝑃 1 𝑝 𝑥 , 1 𝑝 𝑦 , 𝐴 1 𝑎 𝑥 , 1 𝑎 𝑦 , 𝐵 1 𝑏 𝑥 , 1 𝑏 𝑦 , 𝑐ℎ𝑒𝑐𝑘𝑖𝑛𝑔 𝑐𝑜𝑢𝑛𝑡𝑒𝑟 − 𝑐𝑙𝑜𝑐𝑘𝑤𝑖𝑠𝑒 𝑤𝑖𝑙𝑙 𝑏𝑒 • 𝐴 − 𝑃 × 𝐵 − 𝑃 = (𝑝 𝑥−𝑎 𝑥)(𝑝 𝑦−𝑏 𝑦) 𝑎 𝑥 𝑏 𝑦 𝑝 𝑥 𝑝 𝑦 − 𝑝 𝑦−𝑎 𝑦 𝑝 𝑥−𝑏 𝑥 𝑎 𝑦 𝑏 𝑥 𝑝 𝑥 𝑝 𝑦 > 0 ⇔ 𝑎 𝑦 𝑏 𝑥 𝑝 𝑥 − 𝑎 𝑥 𝑝 𝑦 − 𝑏 𝑦 − 𝑎 𝑥 𝑏 𝑦 𝑝 𝑦 − 𝑎 𝑦 𝑝 𝑥 − 𝑏 𝑥 > 0 2. Duplicated Competitors : vary for the Convex Hull algorithm • Regard as one and check it later