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 |
1515
|
Codeforces Global Round 14 |
FINISHED |
False |
10800 |
111857099 |
May 2, 2021, 2:35 p.m. |
Problems
B"To satisfy his love of matching socks, Phoenix has brought his n socks ( n is even) to the sock store. Each of his socks has a color c_i and is either a left sock or right sock. Phoenix can pay one dollar to the sock store to either: The sock store may perform each of these changes any number of times. Note that the color of a left sock doesn't change when it turns into a right sock, and vice versa. A matching pair of socks is a left and right sock with the same color. What is the minimum cost for Phoenix to make n/2 matching pairs? Each sock must be included in exactly one matching pair. The input consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of each test case contains three integers n , l , and r ( 2 <= n <= 2 cdot 10^5 ; n is even; 0 <= l, r <= n ; l+r=n ) -- the total number of socks, and the number of left and right socks, respectively. The next line contains n integers c_i ( 1 <= c_i <= n ) -- the colors of the socks. The first l socks are left socks, while the next r socks are right socks. It is guaranteed that the sum of n across all the test cases will not exceed 2 cdot 10^5 . For each test case, print one integer -- the minimum cost for Phoenix to make n/2 matching pairs. Each sock must be included in exactly one matching pair. In the first test case, Phoenix can pay 2 dollars to: In the second test case, Phoenix can pay 3 dollars to: "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
114954481 |
PiStroke |
D |
May 2, 2021, 5:21 p.m. |
OK |
GNU C11 |
TESTS |
17 |
62 |
3174400 |
|
|
114981671 |
xgzc |
D |
May 3, 2021, 2:49 a.m. |
OK |
GNU C++11 |
TESTS |
17 |
15 |
1433600 |
|
|
114977842 |
jdsb |
D |
May 3, 2021, 1:18 a.m. |
OK |
GNU C++11 |
TESTS |
17 |
30 |
2457600 |
|
|
114977072 |
xgzc |
D |
May 3, 2021, 12:56 a.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
1433600 |
|
|
114952557 |
LegendaryYYQ |
D |
May 2, 2021, 5:13 p.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
1433600 |
|
|
114950771 |
void_basic_learner |
D |
May 2, 2021, 5:06 p.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
1638400 |
|
|
114977894 |
SrO |
D |
May 3, 2021, 1:20 a.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
1638400 |
|
|
114955410 |
yeuyeu |
D |
May 2, 2021, 5:25 p.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
2457600 |
|
|
114951011 |
future17 |
D |
May 2, 2021, 5:07 p.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
2457600 |
|
|
114979992 |
zhaohaikun |
D |
May 3, 2021, 2:13 a.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
2457600 |
|
|
114977312 |
xuchi |
D |
May 3, 2021, 1:04 a.m. |
OK |
GNU C++11 |
TESTS |
17 |
31 |
2457600 |
|
|
114978707 |
Cupids_Bow |
D |
May 3, 2021, 1:43 a.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
819200 |
|
|
114979056 |
tzxydby |
D |
May 3, 2021, 1:51 a.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
819200 |
|
|
114976189 |
black_sheep_wall |
D |
May 3, 2021, 12:25 a.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
1638400 |
|
|
114967843 |
irreversible |
D |
May 2, 2021, 8:23 p.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
1638400 |
|
|
114954191 |
LouiseSariel |
D |
May 2, 2021, 5:20 p.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
1638400 |
|
|
114994642 |
1zerp |
D |
May 3, 2021, 5:43 a.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
1638400 |
|
|
114975030 |
M.w. |
D |
May 2, 2021, 11:42 p.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
2457600 |
|
|
114972095 |
jjkkkk |
D |
May 2, 2021, 10:06 p.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
2457600 |
|
|
114983730 |
yue_guang |
D |
May 3, 2021, 3:27 a.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
2457600 |
|
|
114990159 |
capricious_ |
D |
May 3, 2021, 4:57 a.m. |
OK |
GNU C++14 |
TESTS |
17 |
62 |
4812800 |
|
|
114954766 |
cylx |
D |
May 2, 2021, 5:22 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
46 |
1536000 |
|
|
114970218 |
SCoder |
D |
May 2, 2021, 9:14 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114993855 |
congyu711 |
D |
May 3, 2021, 5:35 a.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114985165 |
Altale0 |
D |
May 3, 2021, 3:50 a.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114980913 |
mTvTm |
D |
May 3, 2021, 2:34 a.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114973226 |
boy_of_kutbilim |
D |
May 2, 2021, 10:41 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114972808 |
boy_of_kutbilim |
D |
May 2, 2021, 10:28 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114972760 |
boy_of_kutbilim |
D |
May 2, 2021, 10:27 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114969314 |
FrozenLeaf |
D |
May 2, 2021, 8:52 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114967212 |
I_Love_YrNameCouldBeHere |
D |
May 2, 2021, 8:12 p.m. |
OK |
GNU C++17 |
TESTS |
17 |
62 |
1638400 |
|
|
114977580 |
zjjws |
D |
May 3, 2021, 1:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
31 |
1331200 |
|
|
114985902 |
crashed |
D |
May 3, 2021, 4 a.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
819200 |
|
|
114979959 |
Passersby |
D |
May 3, 2021, 2:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114971679 |
Prashant.k |
D |
May 2, 2021, 9:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114966436 |
ratingminus |
D |
May 2, 2021, 8 p.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114964338 |
Kregor |
D |
May 2, 2021, 7:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114956728 |
mohammad_ar |
D |
May 2, 2021, 5:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114955316 |
dimasidorenko |
D |
May 2, 2021, 5:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114996418 |
spookywooky |
D |
May 3, 2021, 6 a.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
1638400 |
|
|
114976498 |
happypotato1207 |
D |
May 3, 2021, 12:36 a.m. |
OK |
GNU C++17 (64) |
TESTS |
17 |
46 |
2457600 |
|
|
114994095 |
DavinderSinghKharoud |
D |
May 3, 2021, 5:38 a.m. |
OK |
Java 11 |
TESTS |
17 |
187 |
0 |
|
|
114995796 |
sf14t |
D |
May 3, 2021, 5:54 a.m. |
OK |
Java 11 |
TESTS |
17 |
202 |
0 |
|
|
114951305 |
jainvaidic |
D |
May 2, 2021, 5:08 p.m. |
OK |
Java 11 |
TESTS |
17 |
233 |
0 |
|
|
114991855 |
Sachin_2961 |
D |
May 3, 2021, 5:15 a.m. |
OK |
Java 11 |
TESTS |
17 |
233 |
1331200 |
|
|
114992380 |
cyberphobia |
D |
May 3, 2021, 5:20 a.m. |
OK |
Java 11 |
TESTS |
17 |
234 |
0 |
|
|
114993583 |
akshatj07 |
D |
May 3, 2021, 5:33 a.m. |
OK |
Java 11 |
TESTS |
17 |
248 |
1433600 |
|
|
114989064 |
coderrohan14 |
D |
May 3, 2021, 4:43 a.m. |
OK |
Java 11 |
TESTS |
17 |
249 |
0 |
|
|
114952103 |
Multi-Thread |
D |
May 2, 2021, 5:11 p.m. |
OK |
Java 11 |
TESTS |
17 |
265 |
1843200 |
|
|
114983578 |
coder0687 |
D |
May 3, 2021, 3:25 a.m. |
OK |
Java 11 |
TESTS |
17 |
280 |
12492800 |
|
|
114952757 |
MrOtter |
D |
May 2, 2021, 5:14 p.m. |
OK |
Java 11 |
TESTS |
17 |
311 |
7680000 |
|
|
114969361 |
NerfThis |
D |
May 2, 2021, 8:53 p.m. |
OK |
Java 8 |
TESTS |
17 |
140 |
1945600 |
|
|
114993835 |
Charigardash |
D |
May 3, 2021, 5:35 a.m. |
OK |
Java 8 |
TESTS |
17 |
140 |
3276800 |
|
|
114965329 |
RonWonWon |
D |
May 2, 2021, 7:39 p.m. |
OK |
Java 8 |
TESTS |
17 |
140 |
3276800 |
|
|
114984335 |
FlameFire |
D |
May 3, 2021, 3:37 a.m. |
OK |
Java 8 |
TESTS |
17 |
171 |
2867200 |
|
|
114951278 |
honeysingh18 |
D |
May 2, 2021, 5:08 p.m. |
OK |
Java 8 |
TESTS |
17 |
171 |
4300800 |
|
|
114986254 |
joney_000 |
D |
May 3, 2021, 4:05 a.m. |
OK |
Java 8 |
TESTS |
17 |
234 |
15667200 |
|
|
114990092 |
aryan_rn |
D |
May 3, 2021, 4:56 a.m. |
OK |
Java 8 |
TESTS |
17 |
249 |
5734400 |
|
|
114982657 |
_robindhankhar |
D |
May 3, 2021, 3:09 a.m. |
OK |
Java 8 |
TESTS |
17 |
264 |
15667200 |
|
|
114954822 |
mareshkau |
D |
May 2, 2021, 5:23 p.m. |
OK |
Java 8 |
TESTS |
17 |
265 |
13516800 |
|
|
114967064 |
Adi_7861 |
D |
May 2, 2021, 8:10 p.m. |
OK |
Java 8 |
TESTS |
17 |
326 |
16896000 |
|
|
114952745 |
sylvyrfysh |
D |
May 2, 2021, 5:14 p.m. |
OK |
Kotlin |
TESTS |
17 |
452 |
35942400 |
|
|
114960439 |
kiel.dowdle |
D |
May 2, 2021, 6:48 p.m. |
OK |
Kotlin |
TESTS |
17 |
514 |
18432000 |
|
|
114962091 |
DMN |
D |
May 2, 2021, 6:59 p.m. |
OK |
Mono C# |
TESTS |
17 |
140 |
35532800 |
|
|
114976191 |
alex0211 |
D |
May 3, 2021, 12:25 a.m. |
OK |
MS C++ 2017 |
TESTS |
17 |
62 |
1638400 |
|
|
114965018 |
P___ |
D |
May 2, 2021, 7:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
17 |
78 |
1638400 |
|
|
114952107 |
jjune1416 |
D |
May 2, 2021, 5:11 p.m. |
OK |
MS C++ 2017 |
TESTS |
17 |
78 |
15974400 |
|
|
114969821 |
Vetriti |
D |
May 2, 2021, 9:03 p.m. |
OK |
MS C++ 2017 |
TESTS |
17 |
202 |
3379200 |
|
|
114960683 |
Basem.Maher |
D |
May 2, 2021, 6:49 p.m. |
OK |
MS C++ 2017 |
TESTS |
17 |
312 |
8396800 |
|
|
114953984 |
grottenolm |
D |
May 2, 2021, 5:19 p.m. |
OK |
MS C++ 2017 |
TESTS |
17 |
389 |
8089600 |
|
|
114954002 |
nitish420 |
D |
May 2, 2021, 5:19 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
218 |
20992000 |
|
|
114988082 |
shantol |
D |
May 3, 2021, 4:30 a.m. |
OK |
PyPy 3 |
TESTS |
17 |
249 |
14950400 |
|
|
114951490 |
sushmanth.dampur8780 |
D |
May 2, 2021, 5:09 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
249 |
16076800 |
|
|
114952001 |
Pratyush1606 |
D |
May 2, 2021, 5:11 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
249 |
20377600 |
|
|
114954390 |
harshest2019 |
D |
May 2, 2021, 5:21 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
264 |
15872000 |
|
|
114982324 |
___Neo___ |
D |
May 3, 2021, 3:03 a.m. |
OK |
PyPy 3 |
TESTS |
17 |
264 |
22630400 |
|
|
114953648 |
mynk98 |
D |
May 2, 2021, 5:18 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
265 |
20992000 |
|
|
114969422 |
BOUGA |
D |
May 2, 2021, 8:54 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
265 |
21401600 |
|
|
114966355 |
Aestroix |
D |
May 2, 2021, 7:58 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
265 |
216985600 |
|
|
114951372 |
supachai_pay |
D |
May 2, 2021, 5:08 p.m. |
OK |
PyPy 3 |
TESTS |
17 |
280 |
18739200 |
|
|
114952047 |
prashanttholia |
D |
May 2, 2021, 5:11 p.m. |
OK |
Python 3 |
TESTS |
17 |
265 |
14438400 |
|
|
114951448 |
StillMortal |
D |
May 2, 2021, 5:08 p.m. |
OK |
Python 3 |
TESTS |
17 |
295 |
17715200 |
|
|
114967909 |
kunal_135 |
D |
May 2, 2021, 8:24 p.m. |
OK |
Python 3 |
TESTS |
17 |
311 |
15052800 |
|
|
114969359 |
kunal_135 |
D |
May 2, 2021, 8:53 p.m. |
OK |
Python 3 |
TESTS |
17 |
311 |
15257600 |
|
|
114954552 |
quandum |
D |
May 2, 2021, 5:22 p.m. |
OK |
Python 3 |
TESTS |
17 |
358 |
18739200 |
|
|
114956478 |
praditha_alwis |
D |
May 2, 2021, 5:29 p.m. |
OK |
Python 3 |
TESTS |
17 |
374 |
14745600 |
|
|
114989810 |
sh1194 |
D |
May 3, 2021, 4:52 a.m. |
OK |
Python 3 |
TESTS |
17 |
405 |
14336000 |
|
|
114967737 |
samyaksrivastava9 |
D |
May 2, 2021, 8:21 p.m. |
OK |
Python 3 |
TESTS |
17 |
421 |
14336000 |
|
|
114966980 |
vyas_samarth11 |
D |
May 2, 2021, 8:08 p.m. |
OK |
Python 3 |
TESTS |
17 |
467 |
37171200 |
|
|
114955372 |
WhatsDerivative |
D |
May 2, 2021, 5:25 p.m. |
OK |
Python 3 |
TESTS |
17 |
530 |
19148800 |
|
|
114953660 |
sky |
D |
May 2, 2021, 5:18 p.m. |
OK |
Rust |
TESTS |
17 |
46 |
4812800 |
|
|
remove filters
Back to search problems