Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
278 views
17 pages
ECPC 2017 - Final Round
Jfh
Uploaded by
yassine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save ECPC 2017 - Final Round For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
278 views
17 pages
ECPC 2017 - Final Round
Jfh
Uploaded by
yassine
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save ECPC 2017 - Final Round For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save ECPC 2017 - Final Round For Later
You are on page 1
/ 17
Search
Fullscreen
— Ecrc 2017 ACM International Collegiate Pro Contest EGYPTIAN COLLEGIATE ieee PROGRAMMING CONTEST 42> Academy for November, 4° 2017 The ACM International Collegiate Programming Contest Sponsored by ICPC Foundation ACM ACPC ARAB COLLEGIATE PROGRAMMING CONTEST The Egyptian Collegiate Programming Contest (Contest Problems) oS Arab Academy for Science, Technology & Maritime Transport Alexandria, Egypt November, 2017‘ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest ‘Arab Academy for Science, Technology and Maritime Transport, 2017 Problem A. Assessments Input file: assosenent. in Output file standard output Balloon Color: Yellow ‘As the World Cup approaches, FIFA is holding a worldwide assessment of players. In each assessment, wwe have a line of NV distinct players, the players are standing in the order 0, 1,--- , N — 1. The assessment, is carried out in k rounds, in each round the players run for a long time. When they finish the round, it, sometimes happens (with probability p) that exactly one pair of adjacent players end up swapping their positions; this pair of adjacent players occurs randomly with equal chance. FIFA wants your help finding ut the probability that the final state after the k rounds will have the players « and y swapped. Input ‘The first line of the input contains a single integer 1
N. Output For each test case output a single line displaying the case number and the area of the cheerers rounded to exactly 5 decimal places. The output will be checked with a relative error. Example glorious. in Tandard output z tase Ty aie. B7EE2 3103 Case 2: 287.52220 2104 ase 3: 31096,29444 5 1006 Note « inccircle is the largest circle the will fit inside a polygon that touches every side. « citcumeircle is the circle that passes through each vertex of the regular polygon. ‘ The given figure is a demonstration of the first test case, where the radius of the smallest circle is the given R, and the answer is the area of the grey parts. ‘© The formula P\\ C denotes the area covered in P and not covered in C, as shown in the figure. Page 10 of 16ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest ‘Arab Academy for Science, Technology and Maritime Transport, 2017 Problem H. Half Nice Years Input file: halinice.in Output file: standard output Balloon Color: Black Salah is really optimistic about the qualification of the Egyptian football team for the world cup 2018 ‘He was thinking deeply about why it didn’t happen often that the Egyptian team qualified to the world ccup, 80 he decided to call 2018 a half-nice year. He comes up with the hypothesis that the Egyptian team will always qualify to the world cup only if itis held in a half-nice year. In order to test his hypothesis we need to find the largest half-nice number in a given range [4, B]. He says a given number X is half-nice if its decimal representation can be divided into two non-zero halves(of the same length) and the two halves have a non-trivial common divisor (there's a number d > 1 that divides both parts). In case number X have odd number of digits (2r+1), them the first half will have the first r digits in the decimal representation of X (from the left), and the second half will contain the remaining r + 1 digits in the decimal representation of X. Input ‘The first line of the input consists of a single integer 1 < T < 10° the number of test cases. Each test case consists of one line containing 2 space separated integers A, B, where 10 < A < B < 10" Output For each test case output a single line displaying the case number, then followed by either a single integer X, which is the largest half-nice number in the range [A, B] or ‘impossible’ if there are no such numbers. Example halfnice in standard output z Gaze ii impossible 20 21 Case 2: 2018 10 2019 Case 3: 4005 4000 4006 Note + The number 20122 is a half-nice number (hopefully the Egyptian team qualifies that year), because it’s two halves 20 and 122 have a non-trivial common divisor which is 2. © The number 2000 is not a half-nice number because the second hall is zero. ‘In the third, test case 4005 is half-nice because 40 and 5 share the non-trivial common divisor 5. It is allowed for the second half to have trailing zeros. Page 11 of 16‘ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest Arab Academy for Science, Technology and Maritime Transport, 2017 Problem |. Important matches Input file: important. in Output file: standard output Balloon Color. Light blue In the qualification rounds of the World Cup, there were two disjoint sets of teams 5; = [1,-+-,N] and ‘S) = [1,---,M]. Given a matrix X that decides the importance of the match between team i € Si against team j € Sz by the value X;3. S1 represents the rows of the matrix X, and S represents the columns of the matrix X. We would like to answer Q queries, where each decides the importance of all ‘the matches played by all the teams from the subgroup [4,--- ,C] from $ against all teams from the subgroup [B,-++ ,D] from Sp, such that 1 < A << N,1
(a2 — 20)f(e1) is satisfied, or also equivalently Af (zi) + (1 — A) f (2) > F(Am1 + (1 — A)zr2) is satisfied for 0 < A <1. # If P and Q are convex functions, then P +@ is also convex, where (P + Q)/ P(x) + Qa). Page 14 of 16‘ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest ‘Arab Academy for Science, Technology and Maritime Transport, 2017 Problem K. Katryoshka Input file: katryoshka.in Output file: standard output Balloon Color: White ‘The Egyptian football team will be in Russia for the World Cup, of course they all would like to buy souvenirs for their families. Luckily they met the king of souvenirs of the famous Russian souvenir ‘Matryoshkaj the king makes his masterpiece Katryoshka using different kinds of pieces: wooden eyes, ‘wooden mouths, and wooden bodies. He can form a nice Katryoshka using one of the following, ways: # Two eyes and a body. ‘+ Two eyes, mouth and a body. ‘ Bye, mouth and a body. If the king has n eyes, m mouths and & bodies, what is the largest number of Katryoshkas that can be made by the king? Input ‘The first line of the input contains a single integer 1 < T < 100 the number of test cases. Each test case consists of a single line containing 3 space separated integers ‘n m k’ the number of eyes, mouths and bodies respectively; where 0 < n,m,k < 108, Output For each test case output a line displaying the case number and a, single integer which is the largest number of nice Katryoshka pieces, Example Tatryestia. ia Tanard oatpat A Case tr 123 Case 2: 0 0112 Case 3: 14 14 2t 23 Case 4: 57 90 24 89 Page 15 of 16ACM International Collegiate Programming Contest, Egyptian Collegiate Programming Contest ‘Arab Academy for Science, Technology and Maritime Transport, 2017 Problem L. Lazy ERCD Input file: lazy.in Output file: standard output Balloon Color: Red FIFA changed the style of the World Cup. There are no group rounds anymore, therefore the World Cup will be a pure knockout competition. In a knockout competition, each match that is played between two teams, the losing team is knocked-out of the competition and will not play again, until there's exactly one winner (we are not concerned about other positions, only the first place). Having N teams in the World Cup, our ERCD wants to know how many matches he needs to watch (he ‘will really watch all matches). He is lazy to count that number, so he needs you to write a program that, calculates it Input ‘The first line of the input contains a single integer 1
You might also like
CEEQUAL V5 Assessment Manual For UK Ireland Projects - FINAL 24-08-12 With Covers
PDF
100% (3)
CEEQUAL V5 Assessment Manual For UK Ireland Projects - FINAL 24-08-12 With Covers
140 pages
Between Isolation and Inter Nationalization - The State of Burma-SIIA - Papers - 4
PDF
100% (4)
Between Isolation and Inter Nationalization - The State of Burma-SIIA - Papers - 4
177 pages
Robson2002 Book
PDF
100% (1)
Robson2002 Book
91 pages
Marker's Assessment (Math)
PDF
0% (1)
Marker's Assessment (Math)
8 pages
Binary Solid Solution Assignment
PDF
No ratings yet
Binary Solid Solution Assignment
16 pages
DR Diagram NETVIZ
PDF
100% (1)
DR Diagram NETVIZ
78 pages
ACT FACASI Cartoon Book
PDF
100% (1)
ACT FACASI Cartoon Book
29 pages
SQ L Cookbook
PDF
0% (2)
SQ L Cookbook
1 page
ST202 Lecture Notes
PDF
No ratings yet
ST202 Lecture Notes
70 pages
5 6276116657446322251 PDF
PDF
No ratings yet
5 6276116657446322251 PDF
200 pages
Applied Numerical Analysis 7ed - Curtis F. Gerald, Patrick O. Wheatley - Solutions Manual
PDF
0% (1)
Applied Numerical Analysis 7ed - Curtis F. Gerald, Patrick O. Wheatley - Solutions Manual
6 pages
Prolog Programs
PDF
No ratings yet
Prolog Programs
41 pages
19dcs032 (CCP Practical)
PDF
No ratings yet
19dcs032 (CCP Practical)
58 pages
Week 2 DF Feedback Fall 2012
PDF
100% (1)
Week 2 DF Feedback Fall 2012
6 pages
NUDHF - 2017 - 2022 - Abridged - Version PDF
PDF
No ratings yet
NUDHF - 2017 - 2022 - Abridged - Version PDF
32 pages
Ieee Xtreme 6.0 Faq Sample Questions PDF
PDF
No ratings yet
Ieee Xtreme 6.0 Faq Sample Questions PDF
63 pages
Contest 1
PDF
No ratings yet
Contest 1
19 pages
Showman House
PDF
100% (1)
Showman House
16 pages
Unicode
PDF
No ratings yet
Unicode
17 pages
Third & Final Year Syllabus
PDF
No ratings yet
Third & Final Year Syllabus
80 pages
Bahir Dar University Natural Science-Remedial Result
PDF
No ratings yet
Bahir Dar University Natural Science-Remedial Result
9 pages
The Calculation of The Dosage - Mortality Curve - BLISS 1935
PDF
No ratings yet
The Calculation of The Dosage - Mortality Curve - BLISS 1935
34 pages
Cos112 2011 202 2 B
PDF
No ratings yet
Cos112 2011 202 2 B
28 pages
Software Test Design Specification
PDF
No ratings yet
Software Test Design Specification
17 pages
Blue and Grey Software Developer Technology Resume 1
PDF
100% (1)
Blue and Grey Software Developer Technology Resume 1
1 page
MATHS F3 Q Term 1 2023 Teacher - Co - Ke
PDF
No ratings yet
MATHS F3 Q Term 1 2023 Teacher - Co - Ke
8 pages
Automated Vehicular Identification and Authentication System
PDF
No ratings yet
Automated Vehicular Identification and Authentication System
4 pages
MATH - Year (4) - UNIT 3 - Revision#1
PDF
No ratings yet
MATH - Year (4) - UNIT 3 - Revision#1
11 pages
Benefits of Automatic Optimisation of School Timetables
PDF
No ratings yet
Benefits of Automatic Optimisation of School Timetables
36 pages
ThermoCalc LabReport 18200994
PDF
No ratings yet
ThermoCalc LabReport 18200994
15 pages
Sreenidhi Institute of Science and Technology - BE - Btech - 2017
PDF
No ratings yet
Sreenidhi Institute of Science and Technology - BE - Btech - 2017
40 pages
Chapter 1 Sequences and Limits PDF
PDF
No ratings yet
Chapter 1 Sequences and Limits PDF
12 pages
Deadlock Recovery &preventtion
PDF
No ratings yet
Deadlock Recovery &preventtion
21 pages
Vector Applications
PDF
No ratings yet
Vector Applications
17 pages
CEL-324 Computer Organization and Assembly Language Lab
PDF
No ratings yet
CEL-324 Computer Organization and Assembly Language Lab
9 pages
Cia2 Ai QB Answerkey
PDF
No ratings yet
Cia2 Ai QB Answerkey
17 pages
What Is A Budget
PDF
No ratings yet
What Is A Budget
6 pages
SC1003 Assignment: Typedef Struct Int Char Char
PDF
No ratings yet
SC1003 Assignment: Typedef Struct Int Char Char
12 pages
CDIT 405 Lecture 1 - Introduction To DBMS
PDF
No ratings yet
CDIT 405 Lecture 1 - Introduction To DBMS
4 pages
Abdul Muaaz Fa16-BSE-182-C Muhammad Zeeshan Fa16-BSE-090-C Ahsan Riaz Fa16-BSE-012-C
PDF
No ratings yet
Abdul Muaaz Fa16-BSE-182-C Muhammad Zeeshan Fa16-BSE-090-C Ahsan Riaz Fa16-BSE-012-C
7 pages
Computing Technologies SRM IST, Kattankulathur - 603 203
PDF
No ratings yet
Computing Technologies SRM IST, Kattankulathur - 603 203
7 pages
COA - Practice Set
PDF
No ratings yet
COA - Practice Set
3 pages
Als Fast Facts 2014
PDF
No ratings yet
Als Fast Facts 2014
4 pages
2012-09-12 Learning To Count No Comments
PDF
No ratings yet
2012-09-12 Learning To Count No Comments
10 pages
Computer Networks
PDF
No ratings yet
Computer Networks
5 pages
Pic 10A Midterm 1 - Answers
PDF
No ratings yet
Pic 10A Midterm 1 - Answers
5 pages
Exercicios AOCPC 2020
PDF
No ratings yet
Exercicios AOCPC 2020
18 pages
AUTOSAR 3.2 Based Protocol Data Unit Router Module
PDF
No ratings yet
AUTOSAR 3.2 Based Protocol Data Unit Router Module
6 pages
5 A Case Study: The Domino Puzzle
PDF
No ratings yet
5 A Case Study: The Domino Puzzle
6 pages
Cisco 2 Chapter 11 Study Guide
PDF
No ratings yet
Cisco 2 Chapter 11 Study Guide
7 pages
Dept. of Computer Science & Engineering (CSE) : United International University (UIU)
PDF
No ratings yet
Dept. of Computer Science & Engineering (CSE) : United International University (UIU)
3 pages
Problemset
PDF
No ratings yet
Problemset
15 pages
Set PYTHON PDF
PDF
No ratings yet
Set PYTHON PDF
2 pages
Case Study: Our Client The Opportunity
PDF
No ratings yet
Case Study: Our Client The Opportunity
3 pages
2171909
PDF
No ratings yet
2171909
3 pages
Stub Axle Design Stub Axle Design Stub Axle Design Stub Axle Design
PDF
No ratings yet
Stub Axle Design Stub Axle Design Stub Axle Design Stub Axle Design
1 page
Egyptian Collegiate Programming Contest 2017
PDF
No ratings yet
Egyptian Collegiate Programming Contest 2017
16 pages
External Sources of Secondary Information
PDF
No ratings yet
External Sources of Secondary Information
1 page
2012 Canadian Computing Competition: Senior Division: Sponsor
PDF
No ratings yet
2012 Canadian Computing Competition: Senior Division: Sponsor
10 pages
Jhlgijkhijhikhj: JHV, HNBV, H
PDF
No ratings yet
Jhlgijkhijhikhj: JHV, HNBV, H
1 page
Prof Project PDF
PDF
No ratings yet
Prof Project PDF
1 page
HJHH KLVGJH
PDF
No ratings yet
HJHH KLVGJH
1 page
(DownSub - Com) Stanford CS230 - Deep Learning - Autumn 2018 - Lecture 4 - Adversarial Attacks - GANs
PDF
No ratings yet
(DownSub - Com) Stanford CS230 - Deep Learning - Autumn 2018 - Lecture 4 - Adversarial Attacks - GANs
21 pages
429 Word Transformation: Input and Output
PDF
No ratings yet
429 Word Transformation: Input and Output
2 pages
SQL
PDF
No ratings yet
SQL
2 pages
Train Swapping: Input
PDF
No ratings yet
Train Swapping: Input
1 page
Event Planning: Input
PDF
No ratings yet
Event Planning: Input
1 page
Input
PDF
No ratings yet
Input
1 page
Input
PDF
No ratings yet
Input
1 page
Fractions Again?!: X and Y, X Y, Such That
PDF
No ratings yet
Fractions Again?!: X and Y, X Y, Such That
1 page
Input:, NJBJKNH, VG HVFBGH VFCDFGVDXRDGH
PDF
No ratings yet
Input:, NJBJKNH, VG HVFBGH VFCDFGVDXRDGH
1 page