Submission #4034447
Source Code Expand
n = int(input()) a = [list(map(int,input().split())) for i in range(n)] def keisan(x): ans = 0 for i,j in a: if x < i: ans += i-x elif x > j: ans += x-j return ans x0 = 0 x3 = 1<<32 while x3 - x0 >2: x1 = (x0*2+x3)//3 x2 = (x0+x3*2)//3 y1 = keisan(x1) y2 = keisan(x2) if y1 > y2: x0 = x1 else: x3 = x2 print(min(keisan(x0),keisan(x0+1),keisan(x0+2)))
Submission Info
Submission Time | |
---|---|
Task | E - NarrowRectangles |
User | rookzeno |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 418 Byte |
Status | WA |
Exec Time | 916 ms |
Memory | 62428 KB |
Judge Result
Set Name | Sample | Subtask | All | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | 0 / 700 | ||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 0_004.txt |
Subtask | 0_000, 0_001, 0_004, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 0_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 2_018.txt, 2_019.txt, 2_020.txt, 2_021.txt, 2_022.txt, 2_023.txt, 2_024.txt, 2_025.txt, 2_026.txt, 2_027.txt, 2_028.txt, 2_029.txt, 2_030.txt, 2_031.txt, 2_032.txt, 2_033.txt, 2_034.txt, 2_035.txt, 2_036.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 175 ms | 38256 KB |
0_001.txt | AC | 167 ms | 38256 KB |
0_002.txt | WA | 167 ms | 38256 KB |
0_003.txt | AC | 169 ms | 38256 KB |
0_004.txt | AC | 174 ms | 38256 KB |
1_005.txt | AC | 196 ms | 39152 KB |
1_006.txt | WA | 186 ms | 39152 KB |
1_007.txt | AC | 195 ms | 39024 KB |
1_008.txt | WA | 190 ms | 39152 KB |
1_009.txt | WA | 192 ms | 39152 KB |
1_010.txt | WA | 189 ms | 39280 KB |
1_011.txt | WA | 194 ms | 39152 KB |
1_012.txt | WA | 188 ms | 39152 KB |
1_013.txt | WA | 185 ms | 39152 KB |
1_014.txt | WA | 191 ms | 39280 KB |
1_015.txt | WA | 186 ms | 39152 KB |
1_016.txt | WA | 195 ms | 39152 KB |
1_017.txt | WA | 188 ms | 39152 KB |
2_018.txt | AC | 779 ms | 60376 KB |
2_019.txt | WA | 772 ms | 60120 KB |
2_020.txt | AC | 818 ms | 60376 KB |
2_021.txt | WA | 903 ms | 60376 KB |
2_022.txt | WA | 896 ms | 62428 KB |
2_023.txt | WA | 899 ms | 60376 KB |
2_024.txt | WA | 887 ms | 60376 KB |
2_025.txt | WA | 916 ms | 60760 KB |
2_026.txt | WA | 880 ms | 60376 KB |
2_027.txt | WA | 892 ms | 60504 KB |
2_028.txt | WA | 912 ms | 60504 KB |
2_029.txt | WA | 899 ms | 60376 KB |
2_030.txt | WA | 905 ms | 60504 KB |
2_031.txt | WA | 865 ms | 60376 KB |
2_032.txt | WA | 890 ms | 60504 KB |
2_033.txt | WA | 872 ms | 60376 KB |
2_034.txt | WA | 894 ms | 60248 KB |
2_035.txt | WA | 853 ms | 60632 KB |
2_036.txt | AC | 819 ms | 60888 KB |