ACM ICPC 2017 - Kharagpur Regional
Presentation of solutions
Hard
Easy
Medium
Easy
Easy-medium
Easy-medium
Medium
Medium
Hard
Medium
Med-Hard
Problem 1
Uniform Strings
Accepted: 67
First solved by: kgeccoders_1
Kalyani Government Engineering College
00:03:29
Author: Praveen Dhinwa
Problem 2
Spam Classification Using Neural Net
Accepted: 67
First solved by: Tesla
International Institute of Information Technology, Hyderabad
00:13:05
Author: Praveen Dhinwa
P2 - Spam Classification Using Neural Net
Problem 3
Generating a Permutation
Accepted: at least 44
First solved by: ground floor
Indian Institute of Technology Madras
01:01:30
Author: Archit Karandikar
P3 - Generating a Permutation
Minimum and maximum possible values of f(P)?
Minimum: 1, 2, 3, , .... , n
Maximum: 1, n, 2, (n - 1), …
Let’s take the permutation P = 1, 2, 3, … , n
If we swap n and (n - 1), we get:
P' = 1, 2, 3, … , n, n - 1.
Note that f(P') = f(P) + 1
P3 - Generating a Permutation
Now, swap n with (n - 2).
We get f(P'') = f(P') + 1.
Key observation:
If you move n from the last position to the first position, you can see the f values increase by 1 for every move.
For each number, you can determine their positions uniquely.
Complexity: O(N)
Problem 4
Taxi Making Sharp Turns
Accepted: at least 7
First solved by: De_Dana_Dan
National Institute of Technology Silchar
02:07:49
Author: Praveen Dhinwa and Arjun Arul
P4 - Taxi Making Sharp Turns
Problem 5
Number Game
Accepted: at least 10
First solved by: NDTM
Indian Institute of Technology Guwahati
01:36:00
Author: Balajiganapathi
P5 - Number Game
P5 - Number Game
�
B
C
A
*step + Xi1
*step + Xi2
D
*step + Xi3
P5 - Number Game
Problem 6
Non Overlapping Segments
Accepted: at least 2
First solved by: LongTimeNoC
Indian Institute of Technology Kanpur
01:29:08
Author: Archit Karandikar
P6 - Non Overlapping Segments
Let dp(i, j) denote the
P6 - Non Overlapping Segments
Time Complexity: O(N3)
dp[i][j] = min(dp[k][j-1] + distance(i to k)/R)
If dp[i][j] > N-j then we can fix j segments. Find max such j.
Problem 7
Spanning Tree
Accepted: at least 4
Author: Sidhant Bansal
First solved by: DU_Inception
University of Dhaka
01:56:08
P7 - Spanning Tree
Query: A = {u}, B = {all except u}
P7 - Spanning Tree
P7 - Spanning Tree
P7 - Spanning Tree
How many times does each node appear in a query?
O(log(N))
Cost incurred by one appearance of a node?
1
Total cost = N*log(N) < 104
Problem 8
Chef and XOR Queries
Accepted: at least 4
First solved by: Plumbus
IIT Roorkee
01:47:43
Author: Utkarsh Saxena
P8 - Chef and XOR Queries
P8 - Chef and XOR Queries
P8 - Chef and XOR Queries
2
3
1
4
P8 - Chef and XOR Queries
2
3
1
4
5
P8 - Chef and XOR Queries
P8 - Chef and XOR Queries
2
3
1
4
P8 - Chef and XOR Queries
P8 - Chef and XOR Queries
P8 - Chef and XOR Queries
P8 - Chef and XOR Queries
Problem 9
SAD Queries
Accepted: at least 23
First solved by: NDTM
IIT Guwahati
00:53:14
Author: Archit Karandikar
P9 - SAD Queries
b1
b2
b3
b4
a1
a2
P
Q
P9 - SAD Queries
But will this not TLE?
P9 - SAD Queries
P9 - SAD Queries
P9 - SAD Queries
Problem 10
Science Fair
Author: Utkarsh Saxena
Submits: 0
Accepted: 0
First solved by: 0
00:00:00
P10 - Science Fair
P10 - Science Fair
P10 - Science Fair
P10 - Science Fair: Avoid unwanted student
P10 - Science Fair: How to deal unwanted students
P10 - Science Fair: How to deal unwanted students
P10 - Science Fair: How to deal unwanted students
Problem 11
Black Discs
Submits: 0
Accepted: at least 0
Author: Triveni Mahatha
P11 - Black Discs
P11 - Black Discs
Thanks!