Kotlin Heroes: Episode 8

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1571 Kotlin Heroes: Episode 8 FINISHED False 9900 98205899 Oct. 7, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 41 ) J Two Railroads PROGRAMMING *special

B'There are n cities in Berland, and they are connected by two railroads -- the Main railroad and the Auxiliary railroad. Each city has two railway stations, one connected to the Main railroad (called the Main station), and the other connected to the Auxiliary railroad. The railroads are identical in their structure. The Main railroad consists of n-1 railroad segments; the i -th railroad segment connects the Main station of the city i with the Main station of the city i+1 . Similarly, the Auxiliary railroad consists of n-1 railroad segments; the i -th railroad segment connects the Auxiliary station of the city i with the Auxiliary station of the city i+1 . These railroads are used to transfer different goods and resources from one city to another. In particular, the Ministry of Energetics is interested in using these railroads to transfer coal. The Ministry has estimated the following capabilities of the railroads: To analyze the capacity of the whole railroad network, the Ministry requires a software that would process and answer queries of the following format: Your task is to implement this software. The first line contains one integer n ( 2 <= n <= 3 cdot 10^5 ) -- the number of cities. The second line contains n-1 integers a_1, a_2, ... , a_{n-1} ( 1 <= a_i <= 10^9 ). The third line contains n-1 integers b_1, b_2, ... , b_{n-1} ( 1 <= b_i <= 10^9 ). The fourth line contains n integers c_1, c_2, ... , c_{n} ( 1 <= c_i <= 10^9 ). The fifth line contains one integer q ( 1 <= q <= 3 cdot 10^5 ) -- the number of queries. Then q lines follow, the i -th line contains two integers l_i and r_i ( 1 <= l_i < r_i <= n ) -- the parameters of the i -th query. Print q integers, where the i -th integer should be the answer to the i -th query, i. xe2 x80 x89e. the maximum number of tons of coal '...

Tutorials

Kotlin Heroes 8 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131097568 psycho437 J Oct. 7, 2021, 6:55 p.m. OK Kotlin 1.4 TESTS 61 2948 307302400
131091943 SpyCheese J Oct. 7, 2021, 5:25 p.m. OK Kotlin 1.4 TESTS 61 3088 312217600
131089712 SpyCheese J Oct. 7, 2021, 4:57 p.m. OK Kotlin 1.4 TESTS 61 3775 364646400
131110065 Alan233 J Oct. 8, 2021, 1:33 a.m. OK Kotlin 1.5 TESTS 61 3181 321228800

remove filters

Back to search problems