Работоспособность Codeforces может быть ограничена с 18 июня, 22:00 (МСК) по 19 июня, 6:00 (МСК) в связи с проведением технических работ. Polygon будет работать в обычном режиме. ×

Help with CSES problemset

Правка en1, от skate1512, 2020-10-23 11:13:12

I can't solve this problem using python. I tried many variations of my code but all of them give TLE for 2 test cases. In C++, this problem can be solved using multiset, I tried using dict, collections.Counter, list in python but all of them give TLE. I used stdin and stdout to read the input and output. The time limit is 1 sec and 2 test cases with n = 2⋅10^5, m = 2⋅10^5 pass while the other two don't. I tried searching for solutions but the solutions provided also gave TLE in both cpython and pypy.

These two codes gave the best and similar results. First, Second.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский skate1512 2020-10-26 06:44:28 16 Tiny change: 'G6yDBhkd). ' -> 'G6yDBhkd).\n\nUPD: Solved. '
en2 Английский skate1512 2020-10-23 11:23:19 155
en1 Английский skate1512 2020-10-23 11:13:12 707 Initial revision (published)