SlideShare a Scribd company logo
1 of 9
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
 
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
 
Mechanics engineering statics forces analysis 3D
Mechanics engineering statics forces analysis 3DMechanics engineering statics forces analysis 3D
Mechanics engineering statics forces analysis 3DMohammed8712
 
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)
三角関数の加法定理と関連公式(人間科学のための基礎数学 補足資料)Masahiro Okano
 
Piii taller transformaciones lineales
Piii taller transformaciones linealesPiii taller transformaciones lineales
Piii taller transformaciones linealesJHANDRYALCIVARGUAJAL
 
Properties of coefficient of correlation
Properties of coefficient of correlationProperties of coefficient of correlation
Properties of coefficient of correlationNadeem Uddin
 
Length contraction - Special Relativity
Length contraction - Special RelativityLength contraction - Special Relativity
Length contraction - Special RelativityAtul Bhat
 
taller transformaciones lineales
taller transformaciones linealestaller transformaciones lineales
taller transformaciones linealesemojose107
 
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 correlationREYEMMANUELILUMBA
 
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_rlSean Devlin
 
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 methodsSantiagoGarridoBulln
 
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 methodsSantiagoGarridoBulln
 
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 machinesJinho Lee
 
Applied Algorithms and Structures week999
Applied Algorithms and Structures week999Applied Algorithms and Structures week999
Applied Algorithms and Structures week999fashiontrendzz20
 
LINEAR ALGEBRA, WITH OPTIMIZATION
LINEAR ALGEBRA, WITH OPTIMIZATIONLINEAR ALGEBRA, WITH OPTIMIZATION
LINEAR ALGEBRA, WITH OPTIMIZATIONCHARAK RAY
 
Page rank - from theory to application
Page rank - from theory to applicationPage rank - from theory to application
Page rank - from theory to applicationGAYO3
 
Quadratic form and functional optimization
Quadratic form and functional optimizationQuadratic form and functional optimization
Quadratic form and functional optimizationJunpei Tsuji
 
2Multi_armed_bandits.pptx
2Multi_armed_bandits.pptx2Multi_armed_bandits.pptx
2Multi_armed_bandits.pptxZhiwuGuo1
 
Rational function 11
Rational function 11Rational function 11
Rational function 11AjayQuines
 
Bounded arithmetic in free logic
Bounded arithmetic in free logicBounded arithmetic in free logic
Bounded arithmetic in free logicYamagata 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 implementationJongsu "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 NetworksChenYiHuang5
 
DL_lecture3_regularization_I.pdf
DL_lecture3_regularization_I.pdfDL_lecture3_regularization_I.pdf
DL_lecture3_regularization_I.pdfsagayalavanya2
 
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.pptxssuser01e301
 

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

(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 

Recently uploaded (20)

(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 

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