SlideShare a Scribd company logo
1 of 56
Download to read offline
2017
A.
: ac: 36 / try: 45 / submission: 137
: ( )
A.
•
•
=> 1 == M ?
•
=> == 0 ?
A.
•
•
=> ???
A.
•
A B C D E
user1
user2
user3
user4
user5
A.
•
A B C D E
user1
user2
user3
user4
user5
A.
• .
A B C D E
user1
user2
user3
user4
user5
A.
•
A B C D E
user1
user2
user3
user4
user5
A.
•
A B C D E
user1
user2
user3
user4
user5
A.
• , .
• ( ), bit (DP) .
A.
• , .
=> O(N * M)
• ( ), bit (DP) .
B.
: ac: 0 / try: 7 / submission: 17
: ( )
B.
•
• (1, 1) (N, M) ,
• ?
B.
• ,
.
• -1 INFINITY .
• .
B. (1. flow)
• (1, 1) (N, M)
mincut .
• .
-1 5
7 10 3 4
12 3 8
1 7 -1
B. (1. flow)
• (1, 1) (N, M)
mincut .
• .
-1 5
7 10 3 4
12 3 8
1 7 -1
B. (1. flow)
• (1, 1) (N, M)
mincut .
• .
-1 5
7 10 3 4
12 3 8
1 7 -1
B. (1. flow)
(2,2)
in
(2,2)
out
Capacity : 1010
B. (1. flow)
(2,2)
in
(2,2)
out
10
-1
7 10
(2,1)
in
(2,1)
out
7
(1,1)
in
(1,1)
out
(1,2)
in
(1,2)
out
INF
INF
INF
B. (1. flow)
• Mincut = MaxFlow
•
.
• O((NM)^3)
• -> TLE
• .
-1 5
7 10 3 4
12 3 8
1 7 -1
B. (2. Dijkstra)
• S E !
• S E
.
S
E
B. (2. Dijkstra)
• S E !
• S E
.
•
.
S
E
B. (2. Dijkstra)
• S E !
• S E
.
•
.
S
E
B. (2. Dijkstra)
• S E !
• S E
.
•
.
S
E
B. (2. Dijkstra)
• S E !
• S E
.
•
.
S
E
B. (2. Dijkstra)
• S E !
• S E
.
•
.
-1
-1
B. (2. Dijkstra)
• S E !
• S E
.
•
.
-1
-1
B. (2. Dijkstra)
• S E !
• S E
.
•
.
-1
-1
C.
: ac: 4 / try: 16 / submission: 46
: ( )
C.
•
•
• X
•
C.
• K ,
• K
• K .
• X
K
C.
• K ,
• K .
• ,
• K .
C.
• K
• K .
• K .
C.
• K
• K .
• K .
• => Parametric Search
C.
• K
• K
• O(M * logK)
D.
: ac: 6 / try: 23 / submission: 63
: ( )
D.
•
D.
• 𝑏" .
• 𝑏" = ∑ (−1))
× 𝑘 + 1 ×𝑎)
./0
)1"
• 𝑏" 𝑏0
• 𝑏0 + 𝑏" = ∑ −1 )
×𝑎)
./0
)10 + 𝑎" + −1 ./0
×𝑛×𝑎"
• 𝑏3 + 𝑏0 = ∑ −1 )
×𝑎 )40 %.
./0
)10 + 𝑎0 + −1 ./0
×𝑛×𝑎0
• …
D.
• 𝑏0 + 𝑏" = ∑ −1 )
×𝑎)
./0
)10 + 𝑎" + −1 ./0
×𝑛×𝑎"
• 𝑏3 + 𝑏0 = ∑ −1 )
×𝑎 )40 %.
./0
)10 + 𝑎0 + −1 ./0
×𝑛×𝑎0
• …
• 𝑏" + 𝑏./0 = ∑ −1 )
×𝑎 )4./0 %.
./0
)10 + 𝑎./0 + −1 ./0
×𝑛×𝑎./0
• Dy[i] = ∑ −1 )
×𝑎)46
./0
)10 .
• Dy[i] (Dy[i] + Dy[i+1])
.
E.
: ac: 19 / try: 27 / submission: 64
: ( )
E.
,
K .
E.
𝑥 ,
𝑥	 	 .
𝑥"
,	𝑥0
,	𝑥"
+𝑥0
,	𝑥3
,	𝑥3
+𝑥"
,	𝑥3
+𝑥0
,	𝑥3
+𝑥0
+ 𝑥"
,	𝑥;
, …
x .
1, 10, 11, 100, 101, 110, 111, 1000, ...
E.
1, 10, 11, 100, 101, 110, 111, 1000, ...
x K
K x .
E.
5 10 ,
10 1010(2)
1010(5) = 130 .
E.
K
x O(logK) ,
N
O(NlogK) .
F.
: ac: 0 / try: 1 / submission: 4
: ( )
F.
• N
•
• K X .
•
F.
• D[subroot][kcnt][xcnt]:
subroot kcnt K
xcnt
F.
• D[subroot][kcnt][xcnt]:
• subroot ,
• subroot
•
• .
F.
• D[subroot][kcnt][xcnt]:
• subroot
• K * X ,
• K * X
• N * K2 * X2
F.
• D[subroot][kcnt][xcnt]:
• subroot subtree M
•
• for(int k = 1; k <= K; k++)
for(int x = 0; x <= (M – k) / K; x++)
F.
• D[subroot][kcnt][xcnt]:
• D[subroot][1 ~ K][0 ~ (M – k) / K)]
• M .
F.
• D[subroot][kcnt][xcnt]:
• subtree M1,
• subtree M2
•
•
G.
: ac: 25 / try: 44 / submission: 110
: ( )
G.
•
.
, .
, .
,
.
G.
•
: Dynamic Programing
maxtable[i][j] : (i<=j) i j
i=j : i
i<j : max(i , maxtable[i+1][j])
table[i][j] :
(i<=j) i j ,
i=j : 0
i<j : i<=k<j k
min(table[i][k]+table[k+1][j]+abs(maxtable[i][k]- maxtable[k+1][j]))
• O(N^2)+O(N^3) = O(N^3)

More Related Content

What's hot (15)

Pie chart and polygons
Pie chart and polygonsPie chart and polygons
Pie chart and polygons
 
Estimating Products Lesson 2.5
Estimating Products Lesson 2.5Estimating Products Lesson 2.5
Estimating Products Lesson 2.5
 
Estimating Products
Estimating ProductsEstimating Products
Estimating Products
 
Solve the set of linear equations
Solve the set of linear equationsSolve the set of linear equations
Solve the set of linear equations
 
Basics of CT
Basics of CTBasics of CT
Basics of CT
 
Eco human resources university
Eco human resources universityEco human resources university
Eco human resources university
 
Volleyball fertig
Volleyball fertigVolleyball fertig
Volleyball fertig
 
7th math c2 -l61
7th math c2 -l617th math c2 -l61
7th math c2 -l61
 
Tracking a Ball
Tracking a BallTracking a Ball
Tracking a Ball
 
Feb 23 Extra Min Max Problems
Feb 23 Extra Min Max ProblemsFeb 23 Extra Min Max Problems
Feb 23 Extra Min Max Problems
 
Frequency tables and pie charts constructing and questions
Frequency tables and pie charts   constructing and questionsFrequency tables and pie charts   constructing and questions
Frequency tables and pie charts constructing and questions
 
Adbequipo2
Adbequipo2Adbequipo2
Adbequipo2
 
Applications of calculus in commerce and economics ii
Applications of calculus in commerce and economics ii Applications of calculus in commerce and economics ii
Applications of calculus in commerce and economics ii
 
Angles, triangles and polygons revision card
Angles, triangles and polygons   revision cardAngles, triangles and polygons   revision card
Angles, triangles and polygons revision card
 
Ch 1 Review
Ch 1 ReviewCh 1 Review
Ch 1 Review
 

Similar to shake! 2017 본선문제 풀이

Final exam review sheet # 3 2015
Final exam review sheet # 3 2015Final exam review sheet # 3 2015
Final exam review sheet # 3 2015
mlabuski
 

Similar to shake! 2017 본선문제 풀이 (20)

Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph Databases
 
Practical and Worst-Case Efficient Apportionment
Practical and Worst-Case Efficient ApportionmentPractical and Worst-Case Efficient Apportionment
Practical and Worst-Case Efficient Apportionment
 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
 
Trigo functions
Trigo functionsTrigo functions
Trigo functions
 
Mathematics specialization 11
Mathematics specialization 11Mathematics specialization 11
Mathematics specialization 11
 
Making BIG DATA smaller
Making BIG DATA smallerMaking BIG DATA smaller
Making BIG DATA smaller
 
file6192075727593843027.pptx
file6192075727593843027.pptxfile6192075727593843027.pptx
file6192075727593843027.pptx
 
Deep learning
Deep learningDeep learning
Deep learning
 
Measurement of Rule-based LTLf Declarative Process Specifications
Measurement of Rule-based LTLf Declarative Process SpecificationsMeasurement of Rule-based LTLf Declarative Process Specifications
Measurement of Rule-based LTLf Declarative Process Specifications
 
Mathematics Specialization.pptx
Mathematics Specialization.pptxMathematics Specialization.pptx
Mathematics Specialization.pptx
 
"Mesh of Periodic Minimal Surfaces in CGAL."
"Mesh of Periodic Minimal Surfaces in CGAL.""Mesh of Periodic Minimal Surfaces in CGAL."
"Mesh of Periodic Minimal Surfaces in CGAL."
 
Numerical estimation 1
Numerical estimation 1Numerical estimation 1
Numerical estimation 1
 
Laws of Exponent
Laws of ExponentLaws of Exponent
Laws of Exponent
 
Dynamic Programming Matrix Chain Multiplication
Dynamic Programming Matrix Chain MultiplicationDynamic Programming Matrix Chain Multiplication
Dynamic Programming Matrix Chain Multiplication
 
Cbse sample-papers-class-10-maths-sa-ii-solved-1
Cbse sample-papers-class-10-maths-sa-ii-solved-1Cbse sample-papers-class-10-maths-sa-ii-solved-1
Cbse sample-papers-class-10-maths-sa-ii-solved-1
 
Day 3 review
Day 3 reviewDay 3 review
Day 3 review
 
Tech-1.pptx
Tech-1.pptxTech-1.pptx
Tech-1.pptx
 
Math 3-H6
Math 3-H6Math 3-H6
Math 3-H6
 
Final exam review sheet # 3 2015
Final exam review sheet # 3 2015Final exam review sheet # 3 2015
Final exam review sheet # 3 2015
 
2.ppt
2.ppt2.ppt
2.ppt
 

More from HYUNJEONG KIM

More from HYUNJEONG KIM (9)

알고리즘 연합캠프 세미나 3-B (LCA)
알고리즘 연합캠프 세미나 3-B (LCA)알고리즘 연합캠프 세미나 3-B (LCA)
알고리즘 연합캠프 세미나 3-B (LCA)
 
알고리즘 연합캠프 세미나 3-C (C++11 and ETC)
알고리즘 연합캠프 세미나 3-C (C++11 and ETC)알고리즘 연합캠프 세미나 3-C (C++11 and ETC)
알고리즘 연합캠프 세미나 3-C (C++11 and ETC)
 
알고리즘 연합캠프 세미나 2-C (Segment Tree)
알고리즘 연합캠프 세미나 2-C (Segment Tree)알고리즘 연합캠프 세미나 2-C (Segment Tree)
알고리즘 연합캠프 세미나 2-C (Segment Tree)
 
알고리즘 연합캠프 세미나 1-A (Multi Dimension Segment/Fenwick Tree)
알고리즘 연합캠프 세미나 1-A (Multi Dimension Segment/Fenwick Tree)알고리즘 연합캠프 세미나 1-A (Multi Dimension Segment/Fenwick Tree)
알고리즘 연합캠프 세미나 1-A (Multi Dimension Segment/Fenwick Tree)
 
알고리즘 연합캠프 세미나 1-B (Bitwise DP)
알고리즘 연합캠프 세미나 1-B (Bitwise DP)알고리즘 연합캠프 세미나 1-B (Bitwise DP)
알고리즘 연합캠프 세미나 1-B (Bitwise DP)
 
알고리즘 연합캠프 세미나 1-C (알고리즘 설계와 모델링 및 수학)
알고리즘 연합캠프 세미나 1-C (알고리즘 설계와 모델링 및 수학)알고리즘 연합캠프 세미나 1-C (알고리즘 설계와 모델링 및 수학)
알고리즘 연합캠프 세미나 1-C (알고리즘 설계와 모델링 및 수학)
 
알고리즘 연합캠프 세미나 1-D (Knapsack, Tree DP)
알고리즘 연합캠프 세미나 1-D (Knapsack, Tree DP)알고리즘 연합캠프 세미나 1-D (Knapsack, Tree DP)
알고리즘 연합캠프 세미나 1-D (Knapsack, Tree DP)
 
shake! 2017 예선 문제 풀이
shake! 2017 예선 문제 풀이shake! 2017 예선 문제 풀이
shake! 2017 예선 문제 풀이
 
shake! 2016 예선 문제 풀이
shake! 2016 예선 문제 풀이shake! 2016 예선 문제 풀이
shake! 2016 예선 문제 풀이
 

Recently uploaded

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 

Recently uploaded (20)

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 

shake! 2017 본선문제 풀이