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 |
|---|---|---|---|---|---|---|
| 761 | Codeforces Round 394 (Div. 2) | FINISHED | False | 7200 | 290618685 | Jan. 31, 2017, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 523 ) | F | Dasha and Photos | PROGRAMMING | brute force data structures dp implementation | 2900 |
Dasha decided to have a rest after solving the problem D and began to look photos from previous competitions. Let's call photos as the matrix with the size n × m , which consists of lowercase English letters. Some k photos especially interested her, because they can be received from photo-template by painting a rectangular area in a certain color. Let's call such photos special. More formally the i -th special photo is received from the photo-template by replacing all characters on some rectangle with upper left corner of the cell with coordinates ( a i , b i ) and lower right corner in the cell with coordinates ( c i , d i ) to the symbol e i . Dasha asks you to find the special photo so that the total distance from it to all other special photos is minimum. And calculate this distance. Determine the distance between two photos as the sum of distances between all corresponding letters. The distance between two letters is the difference module of their positions in the alphabet. For example, the distance between letters ' h ' and ' m ' equals |8 - 13| = 5 , because the letter ' h ' is the 8-th in the alphabet, the letter ' m ' is the 13-th. The first line contains three integers n , m , k (1 ≤ n , m ≤ 10 3 , 1 ≤ k ≤ 3·10 5 ) — the number of strings in the photo-template, the number of columns and the number of special photos which are interesting for Dasha. The next n lines contains the string with m length which consists of little Latin characters — the description of the photo-template. Each of the next k lines contains the description of the special photo in the following format, " a i b i c i d i e i " (1 ≤ a i ≤ c i ≤ n , 1 ≤ b i ≤ d i ≤ m ) , where ( a i , b i ) — is the coordinate of the upper left corner of the rectangle, ( c i , d i ) — is the description of the lower right corner, and e i — is the little Latin letter which replaces the photo-template in the described rectangle. In the only line print the minimum total distance from the found spec |
| Codeforces Round #394 (Div. 2) [Editorial] |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 24353243 | rainboy | F | Feb. 1, 2017, 7:22 p.m. | OK | GNU C | TESTS | 77 | 686 | 433766400 | 2900 | |
| 24337202 | Tebak_Siapa_Aku | F | Feb. 1, 2017, 8:46 a.m. | OK | GNU C | TESTS | 77 | 951 | 226816000 | 2900 | |
| 25157262 | samboss | F | March 2, 2017, 7:15 p.m. | OK | GNU C++ | TESTS | 77 | 436 | 335257600 | 2900 | |
| 24345831 | apiadu | F | Feb. 1, 2017, 2:04 p.m. | OK | GNU C++ | TESTS | 77 | 452 | 335257600 | 2900 | |
| 24449377 | progg_admin | F | Feb. 5, 2017, 11:01 a.m. | OK | GNU C++ | TESTS | 77 | 467 | 335257600 | 2900 | |
| 24555275 | imverypupil | F | Feb. 9, 2017, 5:53 p.m. | OK | GNU C++ | TESTS | 77 | 468 | 335257600 | 2900 | |
| 34102790 | yasugongshang | F | Jan. 12, 2018, 9:33 a.m. | OK | GNU C++ | TESTS | 77 | 498 | 233676800 | 2900 | |
| 27883667 | SHRst | F | June 18, 2017, 11:41 a.m. | OK | GNU C++ | TESTS | 77 | 499 | 359731200 | 2900 | |
| 25162711 | zhan8855 | F | March 3, 2017, 4:53 a.m. | OK | GNU C++ | TESTS | 77 | 499 | 529612800 | 2900 | |
| 24331820 | czllgzmzl | F | Feb. 1, 2017, 3:19 a.m. | OK | GNU C++ | TESTS | 77 | 514 | 441241600 | 2900 | |
| 24674833 | __N__ | F | Feb. 14, 2017, 3:48 p.m. | OK | GNU C++ | TESTS | 77 | 530 | 231628800 | 2900 | |
| 24406495 | ztx | F | Feb. 3, 2017, 9:32 a.m. | OK | GNU C++ | TESTS | 77 | 530 | 334028800 | 2900 | |
| 25049606 | sagitta | F | Feb. 26, 2017, 10:51 a.m. | OK | GNU C++11 | TESTS | 77 | 421 | 339251200 | 2900 | |
| 30326540 | Jayzhang | F | Sept. 14, 2017, 11:27 a.m. | OK | GNU C++11 | TESTS | 77 | 451 | 330854400 | 2900 | |
| 26454257 | cen | F | April 17, 2017, 12:21 p.m. | OK | GNU C++11 | TESTS | 77 | 452 | 384409600 | 2900 | |
| 24799666 | vepifanov | F | Feb. 19, 2017, 10:32 a.m. | OK | GNU C++11 | TESTS | 77 | 467 | 330342400 | 2900 | |
| 50873112 | StartAgain | F | March 6, 2019, 3:56 a.m. | OK | GNU C++11 | TESTS | 77 | 467 | 334438400 | 2900 | |
| 24623339 | Wuvin | F | Feb. 13, 2017, 7:43 a.m. | OK | GNU C++11 | TESTS | 77 | 467 | 335257600 | 2900 | |
| 24446967 | mqd | F | Feb. 5, 2017, 8:02 a.m. | OK | GNU C++11 | TESTS | 77 | 467 | 335257600 | 2900 | |
| 24479697 | newgate | F | Feb. 7, 2017, 2:35 a.m. | OK | GNU C++11 | TESTS | 77 | 483 | 335257600 | 2900 | |
| 35196996 | zhouyuyang | F | Feb. 13, 2018, 10:57 a.m. | OK | GNU C++11 | TESTS | 77 | 498 | 336998400 | 2900 | |
| 24348806 | ohweonfire | F | Feb. 1, 2017, 3:58 p.m. | OK | GNU C++11 | TESTS | 77 | 499 | 276480000 | 2900 | |
| 40982618 | ReaLNero1 | F | July 30, 2018, 6:30 p.m. | OK | GNU C++14 | TESTS | 77 | 436 | 320000000 | 2900 | |
| 24801674 | alkr | F | Feb. 19, 2017, 12:21 p.m. | OK | GNU C++14 | TESTS | 77 | 436 | 321945600 | 2900 | |
| 24801530 | alkr | F | Feb. 19, 2017, 12:13 p.m. | OK | GNU C++14 | TESTS | 77 | 452 | 329932800 | 2900 | |
| 27199970 | Shizuo | F | May 18, 2017, 3:42 p.m. | OK | GNU C++14 | TESTS | 77 | 452 | 331161600 | 2900 | |
| 64055414 | _HossamYehia_ | F | Nov. 2, 2019, 1:05 a.m. | OK | GNU C++14 | TESTS | 77 | 467 | 232857600 | 2900 | |
| 64055807 | _HossamYehia_ | F | Nov. 2, 2019, 1:19 a.m. | OK | GNU C++14 | TESTS | 77 | 483 | 232857600 | 2900 | |
| 64055829 | _HossamYehia_ | F | Nov. 2, 2019, 1:20 a.m. | OK | GNU C++14 | TESTS | 77 | 499 | 232857600 | 2900 | |
| 26134504 | WillyPillow | F | April 5, 2017, 2:34 a.m. | OK | GNU C++14 | TESTS | 77 | 499 | 336076800 | 2900 | |
| 26134474 | WillyPillow | F | April 5, 2017, 2:29 a.m. | OK | GNU C++14 | TESTS | 77 | 514 | 336076800 | 2900 | |
| 64054978 | compiler_101 | F | Nov. 2, 2019, 12:46 a.m. | OK | GNU C++14 | TESTS | 77 | 530 | 265216000 | 2900 | |
| 54177034 | andrew | F | May 15, 2019, 2:16 p.m. | OK | GNU C++17 | TESTS | 77 | 545 | 344473600 | 2900 | |
| 50487103 | lpa20020220 | F | Feb. 25, 2019, 12:02 p.m. | OK | GNU C++17 | TESTS | 77 | 654 | 474931200 | 2900 | |
| 56461190 | oToToT | F | July 3, 2019, 6:53 a.m. | OK | GNU C++17 | TESTS | 77 | 810 | 224768000 | 2900 | |
| 59337255 | JioFell | F | Aug. 23, 2019, 5:46 a.m. | OK | GNU C++17 | TESTS | 77 | 810 | 229580800 | 2900 | |
| 64085164 | Ali_ElMasry | F | Nov. 2, 2019, 11:13 a.m. | OK | GNU C++17 | TESTS | 77 | 889 | 444211200 | 2900 | |
| 52500742 | Abdelrhman_Akram | F | April 8, 2019, 3:56 p.m. | OK | GNU C++17 | TESTS | 77 | 1980 | 445132800 | 2900 | |
| 68010755 | DANDROZAVR | F | Dec. 31, 2019, 3:38 p.m. | OK | GNU C++17 | TESTS | 77 | 3369 | 265318400 | 2900 | |
| 24621200 | JialinOuyang | F | Feb. 13, 2017, 5:12 a.m. | OK | Java 8 | TESTS | 77 | 904 | 285081600 | 2900 | |
| 24573549 | donli | F | Feb. 10, 2017, 4:26 p.m. | OK | Java 8 | TESTS | 77 | 1512 | 414003200 | 2900 | |
| 24317353 | uwi | F | Jan. 31, 2017, 4:15 p.m. | OK | Java 8 | TESTS | 77 | 1513 | 488140800 | 2900 | |
| 24332564 | Dukkha | F | Feb. 1, 2017, 4:14 a.m. | OK | Java 8 | TESTS | 77 | 1840 | 503808000 | 2900 | |
| 24437690 | esbybb | F | Feb. 4, 2017, 5:24 p.m. | OK | Java 8 | TESTS | 77 | 3447 | 536166400 | 2900 | |
| 24336231 | og.kostya | F | Feb. 1, 2017, 8:02 a.m. | OK | MS C# | TESTS | 77 | 1340 | 355328000 | 2900 | |
| 24336003 | og.kostya | F | Feb. 1, 2017, 7:56 a.m. | OK | MS C# | TESTS | 77 | 2245 | 248934400 | 2900 | |
| 24335936 | og.kostya | F | Feb. 1, 2017, 7:53 a.m. | OK | MS C# | TESTS | 77 | 3197 | 246476800 | 2900 | |
| 26156626 | RCG | F | April 5, 2017, 6:40 p.m. | OK | MS C++ | TESTS | 77 | 779 | 442675200 | 2900 |
Back to search problems