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 |
---|---|---|---|---|---|---|
1578 | ICPC WF Moscow Invitational Contest - Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 98729699 | Oct. 1, 2021, 1:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 46 ) | D | Dragon Curve | PROGRAMMING |
B'A dragon curve is a self-similar fractal curve. In this problem, it is a curve that consists of straight-line segments of the same length connected at right angles. A simple way to construct a dragon curve is as follows: take a strip of paper, fold it in half n times in the same direction, then partially unfold it such that the segments are joined at right angles. This is illustrated here: In this example, a dragon curve of order 3 is constructed. In general, a dragon curve of a higher order will have a dragon curve of a lower order as its prefix. This allows us to define a dragon curve of infinite order, which is the limit of dragon curves of a finite order as the order approaches infinity. Consider four dragon curves of infinite order. Each starts at the origin (the point (0,0) ), and the length of each segment is sqrt2 . The first segments of the curves end at the points (1,1) , (-1,1) , (-1,-1) and (1,-1) , respectively. The first turn of each curve is left (that is, the second segment of the first curve ends at the point (0,2) ). In this case, every segment is a diagonal of an axis-aligned unit square with integer coordinates, and it can be proven that there is exactly one segment passing through every such square. Given a point (x,y) , your task is to find on which of the four curves lies the segment passing through the square with the opposite corners at (x,y) and (x+1,y+1) , as well as the position of that segment on that curve. The curves are numbered 1 through 4 . Curve 1 goes through (1,1) , 2 through (-1,1) , 3 through (-1,-1) , and 4 through (1,-1) . The segments are numbered starting with 1 . The first line contains an integer n ( 1 <= n <= 2 cdot10^5 ) -- the number of test cases. Each of the following n lines contains two integers x and y ( -10^9 <= x,y <= 10^9 ) -- the coordinates. F'... |
Tutorial (PDF) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
130477645 | sshs18102 dillon0108 L0TUS | D | Oct. 1, 2021, 3:04 p.m. | OK | GNU C++14 | TESTS | 3 | 577 | 0 | ||
130475060 | Fulisike Miracle03 Retired_MiFaFaOvO | D | Oct. 1, 2021, 2:41 p.m. | OK | GNU C++14 | TESTS | 3 | 1356 | 3891200 | ||
130470143 | user202729_ tanphatls987 | D | Oct. 1, 2021, 1:58 p.m. | OK | GNU C++17 | TESTS | 3 | 436 | 3788800 | ||
130526600 | nor | D | Oct. 2, 2021, 5:52 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 202 | 4300800 | ||
130491015 | tlwpdus ainta molamola. | D | Oct. 1, 2021, 5:25 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 1045 | 4300800 | ||
130489149 | snuke hos.lyric maroonrk | D | Oct. 1, 2021, 5:06 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 1294 | 4300800 | ||
130493621 | toilanvd_HUST TranLeHiep 6aren | D | Oct. 1, 2021, 5:51 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 4180 | 0 |
Back to search problems