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.
Problems
B'Long is a huge fan of CFC (Codeforces Fried Chicken). But the price of CFC is increasing, so he decides to breed the chicken on his own farm. His farm is presented by a rectangle grid with r rows and c columns. Some of these cells contain rice, others are empty. k chickens are living on his farm. The number of chickens is not greater than the number of cells with rice on the farm. Long wants to give his chicken playgrounds by assigning these farm cells to his chickens. He would like to satisfy the following requirements: Long also wants to prevent his chickens from fighting for food. Hence he wants the difference between the maximum and the minimum number of cells with rice assigned to a chicken to be as small as possible. Please help him. Each test contains multiple test cases. The first line contains the number of test cases T ( 1 <= T <= 2 cdot 10^4 ). Description of the test cases follows. The first line of each test case contains three integers r , c and k ( 1 <= q r, c <= q 100, 1 <= q k <= q 62 ), representing the size of Long 's farm and the number of chickens Long has. Each of the next r lines contains c characters, each is either "." or "R", representing an empty cell or a cell with rice. It is guaranteed that the number of chickens is not greater than the number of cells with rice on the farm. It is guaranteed that the sum of r cdot c over all test cases does not exceed 2 cdot 10^4 . For each test case, print r lines with c characters on each line. Each character should be either a lowercase English character, an uppercase English character, or a digit. Two characters should be equal if and only if the two corresponding cells are assigned to the same chicken. Uppercase and lowercase characters are considered different, so "A" and "a" belong to two different chickens. If there are multiple optimal answers, print any. These pictures explain the sample output. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
65362050 |
Gassa |
A |
Nov. 19, 2019, 3:02 p.m. |
OK |
D |
TESTS |
49 |
46 |
0 |
|
1900 |
65366516 |
iica |
A |
Nov. 19, 2019, 3:15 p.m. |
OK |
D |
TESTS |
49 |
46 |
102400 |
|
1900 |
65358889 |
hos.lyric |
A |
Nov. 19, 2019, 2:53 p.m. |
OK |
D |
TESTS |
49 |
46 |
4198400 |
|
1900 |
65356454 |
physics0523 |
A |
Nov. 19, 2019, 2:46 p.m. |
OK |
GNU C11 |
TESTS |
49 |
78 |
0 |
|
1900 |
67192853 |
Mr_Wu |
A |
Dec. 19, 2019, 7:49 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
67051874 |
master_rat1 |
A |
Dec. 17, 2019, 4:38 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
66536745 |
He_Ren |
A |
Dec. 9, 2019, 9:54 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
66315911 |
acniu |
A |
Dec. 5, 2019, 1:05 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
66226802 |
2016wudi |
A |
Dec. 3, 2019, 12:55 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
68934726 |
Flamire |
A |
Jan. 16, 2020, 12:26 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
66049831 |
luogu_bot3 |
A |
Nov. 30, 2019, 4:41 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
65802432 |
KaiserYang |
A |
Nov. 27, 2019, 8:05 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
66049875 |
oldherd |
A |
Nov. 30, 2019, 4:43 p.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
67940839 |
geneanlyz |
A |
Dec. 30, 2019, 12:38 a.m. |
OK |
GNU C++11 |
TESTS |
49 |
31 |
0 |
|
1900 |
65691834 |
Owen_codeisking |
A |
Nov. 25, 2019, 5:29 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
30 |
0 |
|
1900 |
66610181 |
tichnas |
A |
Dec. 10, 2019, 8:57 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
30 |
0 |
|
1900 |
65372186 |
21August |
A |
Nov. 19, 2019, 3:34 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
30 |
102400 |
|
1900 |
65409361 |
vonatlus |
A |
Nov. 20, 2019, 2:57 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
30 |
204800 |
|
1900 |
65615511 |
bao_do |
A |
Nov. 24, 2019, 3:17 a.m. |
OK |
GNU C++14 |
TESTS |
49 |
30 |
409600 |
|
1900 |
69252539 |
dillon0108 |
A |
Jan. 21, 2020, 2:42 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
31 |
0 |
|
1900 |
68095533 |
Sofokles |
A |
Jan. 2, 2020, 8:29 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
31 |
0 |
|
1900 |
68092570 |
Diegogrc |
A |
Jan. 2, 2020, 6:51 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
31 |
0 |
|
1900 |
68040354 |
Anadi |
A |
Jan. 1, 2020, 2:01 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
31 |
0 |
|
1900 |
67045677 |
torpedo11 |
A |
Dec. 16, 2019, 10:02 p.m. |
OK |
GNU C++14 |
TESTS |
49 |
31 |
0 |
|
1900 |
65361589 |
HCPS42 |
A |
Nov. 19, 2019, 3:01 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
15 |
204800 |
|
1900 |
65578311 |
Arpa |
A |
Nov. 23, 2019, 10:10 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
0 |
|
1900 |
65688710 |
HyscereXD |
A |
Nov. 25, 2019, 2:51 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
0 |
|
1900 |
65357991 |
seiko.iwasawa |
A |
Nov. 19, 2019, 2:51 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
204800 |
|
1900 |
65720770 |
gachiBASS |
A |
Nov. 25, 2019, 6:56 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
204800 |
|
1900 |
66246273 |
IncubatorMan |
A |
Dec. 3, 2019, 8:44 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
204800 |
|
1900 |
65363549 |
hloya_ygrt |
A |
Nov. 19, 2019, 3:06 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
204800 |
|
1900 |
66652056 |
Utkarsh.25dec |
A |
Dec. 11, 2019, 7:41 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
30 |
6553600 |
|
1900 |
68438143 |
stArliGht |
A |
Jan. 9, 2020, 9:49 a.m. |
OK |
GNU C++17 |
TESTS |
49 |
31 |
0 |
|
1900 |
68465451 |
2shraaf |
A |
Jan. 9, 2020, 8:05 p.m. |
OK |
GNU C++17 |
TESTS |
49 |
31 |
0 |
|
1900 |
65910096 |
1NVAL1D |
A |
Nov. 28, 2019, 12:35 p.m. |
OK |
Java 11 |
TESTS |
49 |
187 |
0 |
|
1900 |
65359857 |
Kharouba |
A |
Nov. 19, 2019, 2:56 p.m. |
OK |
Java 11 |
TESTS |
49 |
202 |
0 |
|
1900 |
65361320 |
Musin |
A |
Nov. 19, 2019, 3 p.m. |
OK |
Java 11 |
TESTS |
49 |
233 |
0 |
|
1900 |
65547738 |
ZeyadKhattab |
A |
Nov. 22, 2019, 5:41 p.m. |
OK |
Java 8 |
TESTS |
49 |
124 |
0 |
|
1900 |
68364608 |
Ahmad_Elsagheer |
A |
Jan. 7, 2020, 3:28 p.m. |
OK |
Java 8 |
TESTS |
49 |
124 |
0 |
|
1900 |
65451107 |
StayAwayFromBitches |
A |
Nov. 20, 2019, 6:09 p.m. |
OK |
Java 8 |
TESTS |
49 |
124 |
0 |
|
1900 |
65357461 |
uwi |
A |
Nov. 19, 2019, 2:49 p.m. |
OK |
Java 8 |
TESTS |
49 |
124 |
0 |
|
1900 |
65369551 |
barakraganosungam |
A |
Nov. 19, 2019, 3:25 p.m. |
OK |
Java 8 |
TESTS |
49 |
124 |
1843200 |
|
1900 |
69670161 |
yaoct |
A |
Jan. 28, 2020, 12:44 p.m. |
OK |
Java 8 |
TESTS |
49 |
139 |
0 |
|
1900 |
65357190 |
SergeyMelnikov |
A |
Nov. 19, 2019, 2:48 p.m. |
OK |
Java 8 |
TESTS |
49 |
139 |
0 |
|
1900 |
65356542 |
jdurie |
A |
Nov. 19, 2019, 2:47 p.m. |
OK |
Java 8 |
TESTS |
49 |
139 |
0 |
|
1900 |
65360249 |
dalt |
A |
Nov. 19, 2019, 2:57 p.m. |
OK |
Java 8 |
TESTS |
49 |
139 |
19251200 |
|
1900 |
67174451 |
Xylenox |
A |
Dec. 18, 2019, 6:36 p.m. |
OK |
Java 8 |
TESTS |
49 |
140 |
0 |
|
1900 |
65396339 |
Tlatoani |
A |
Nov. 19, 2019, 7:15 p.m. |
OK |
Kotlin |
TESTS |
49 |
202 |
0 |
|
1900 |
65360589 |
r57shell |
A |
Nov. 19, 2019, 2:58 p.m. |
OK |
MS C++ |
TESTS |
49 |
31 |
0 |
|
1900 |
65358576 |
math957963 |
A |
Nov. 19, 2019, 2:52 p.m. |
OK |
MS C++ |
TESTS |
49 |
31 |
0 |
|
1900 |
65365838 |
tarattata1 |
A |
Nov. 19, 2019, 3:13 p.m. |
OK |
MS C++ |
TESTS |
49 |
31 |
102400 |
|
1900 |
65357550 |
Apsara |
A |
Nov. 19, 2019, 2:50 p.m. |
OK |
MS C++ |
TESTS |
49 |
46 |
0 |
|
1900 |
65358911 |
Madball |
A |
Nov. 19, 2019, 2:53 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
31 |
0 |
|
1900 |
67221356 |
scorpiowf |
A |
Dec. 19, 2019, 3:07 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
31 |
102400 |
|
1900 |
65360815 |
pichulia |
A |
Nov. 19, 2019, 2:59 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
31 |
1024000 |
|
1900 |
65363142 |
re_eVVorld |
A |
Nov. 19, 2019, 3:05 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
62 |
307200 |
|
1900 |
65358322 |
Friska |
A |
Nov. 19, 2019, 2:52 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
109 |
307200 |
|
1900 |
65357227 |
Khazhak |
A |
Nov. 19, 2019, 2:49 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
124 |
307200 |
|
1900 |
65517228 |
oldFlag |
A |
Nov. 22, 2019, 6:37 a.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
140 |
102400 |
|
1900 |
65401010 |
AlexanderL |
A |
Nov. 19, 2019, 10:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
140 |
307200 |
|
1900 |
65391633 |
pseuda |
A |
Nov. 19, 2019, 5:44 p.m. |
OK |
MS C++ 2017 |
TESTS |
49 |
342 |
409600 |
|
1900 |
65560759 |
Svlad_Cjelli |
A |
Nov. 23, 2019, 2:44 a.m. |
OK |
Ocaml |
TESTS |
49 |
77 |
2662400 |
|
1900 |
65686755 |
Svlad_Cjelli |
A |
Nov. 25, 2019, 12:35 a.m. |
OK |
Ocaml |
TESTS |
49 |
93 |
409600 |
|
1900 |
65363656 |
nagiss |
A |
Nov. 19, 2019, 3:07 p.m. |
OK |
PyPy 3 |
TESTS |
49 |
249 |
5324800 |
|
1900 |
65362327 |
titia |
A |
Nov. 19, 2019, 3:03 p.m. |
OK |
PyPy 3 |
TESTS |
49 |
265 |
7065600 |
|
1900 |
65361346 |
Kiri8128 |
A |
Nov. 19, 2019, 3 p.m. |
OK |
PyPy 3 |
TESTS |
49 |
280 |
7884800 |
|
1900 |
65358988 |
_Kee |
A |
Nov. 19, 2019, 2:53 p.m. |
OK |
PyPy 3 |
TESTS |
49 |
280 |
8294400 |
|
1900 |
65362983 |
neterukun |
A |
Nov. 19, 2019, 3:05 p.m. |
OK |
PyPy 3 |
TESTS |
49 |
311 |
8192000 |
|
1900 |
65414943 |
pineriver |
A |
Nov. 20, 2019, 6:26 a.m. |
OK |
PyPy 3 |
TESTS |
49 |
389 |
9728000 |
|
1900 |
66170479 |
Insta-x |
A |
Dec. 2, 2019, 10:05 a.m. |
OK |
PyPy 3 |
TESTS |
49 |
577 |
9932800 |
|
1900 |
65375436 |
nwi |
A |
Nov. 19, 2019, 3:46 p.m. |
OK |
Python 2 |
TESTS |
49 |
295 |
716800 |
|
1900 |
66856014 |
sritha |
A |
Dec. 14, 2019, 12:15 p.m. |
OK |
Python 3 |
TESTS |
49 |
358 |
307200 |
|
1900 |
66972185 |
sruthi_1729 |
A |
Dec. 15, 2019, 1:32 p.m. |
OK |
Python 3 |
TESTS |
49 |
405 |
307200 |
|
1900 |
66371254 |
Jsxft |
A |
Dec. 5, 2019, 10:20 p.m. |
OK |
Python 3 |
TESTS |
49 |
499 |
2048000 |
|
1900 |
65618676 |
vishnutheerthep |
A |
Nov. 24, 2019, 5:20 a.m. |
OK |
Python 3 |
TESTS |
49 |
514 |
3584000 |
|
1900 |
65361015 |
sansen |
A |
Nov. 19, 2019, 2:59 p.m. |
OK |
Rust |
TESTS |
49 |
46 |
512000 |
|
1900 |
remove filters
Back to search problems