Codeforces Round 671 (Div. 2)

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
1419 Codeforces Round 671 (Div. 2) FINISHED False 7200 136740263 Sept. 19, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15601 ) C Killjoy PROGRAMMING greedy implementation math

B"A new agent called Killjoy invented a virus COVID-2069 that infects accounts on Codeforces. Each account has a rating, described by an integer (it can possibly be negative or very large). Killjoy's account is already infected and has a rating equal to x . Its rating is constant. There are n accounts except hers, numbered from 1 to n . The i -th account's initial rating is a_i . Any infected account (initially the only infected account is Killjoy's) instantly infects any uninfected account if their ratings are equal. This can happen at the beginning (before any rating changes) and after each contest. If an account is infected, it can not be healed. Contests are regularly held on Codeforces. In each contest, any of these n accounts (including infected ones) can participate. Killjoy can't participate. After each contest ratings are changed this way: each participant's rating is changed by an integer, but the sum of all changes must be equal to zero. New ratings can be any integer. Find out the minimal number of contests needed to infect all accounts. You can choose which accounts will participate in each contest and how the ratings will change. It can be proven that all accounts can be infected in some finite number of contests. The first line contains a single integer t (1 <= t <= 100) -- the number of test cases. The next 2t lines contain the descriptions of all test cases. The first line of each test case contains two integers n and x ( 2 <= n <= 10^3 , -4000 <= x <= 4000 ) -- the number of accounts on Codeforces and the rating of Killjoy's account. The second line of each test case contains n integers a_1, a_2, ... , a_n (-4000 <= a_i <= 4000) -- the ratings of other accounts. For each test case output the minimal number of contests needed to infect all accounts. In the first test case it's possible to make all ratings equal to 69 . First acc"...

Tutorials

Codeforces Round #671 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
93293688 dbdxzwh C Sept. 20, 2020, 1:59 a.m. OK Clang++17 Diagnostics TESTS 68 374 0
93293412 impuk C Sept. 20, 2020, 1:50 a.m. OK FPC TESTS 68 46 0
93295918 quangngg C Sept. 20, 2020, 3 a.m. OK FPC TESTS 68 46 7987200
93272987 ruban C Sept. 19, 2020, 6:29 p.m. OK FPC TESTS 68 46 135987200
93304952 aryanpandeya C Sept. 20, 2020, 5:55 a.m. OK GNU C11 TESTS 68 46 0
93299790 djsfyh140 C Sept. 20, 2020, 4:24 a.m. OK GNU C11 TESTS 68 46 0
93295971 QwQcOrZ C Sept. 20, 2020, 3:02 a.m. OK GNU C++11 TESTS 68 31 0
93295655 SSerxhs C Sept. 20, 2020, 2:53 a.m. OK GNU C++11 TESTS 68 31 0
93295096 pbrinotwyh C Sept. 20, 2020, 2:39 a.m. OK GNU C++11 TESTS 68 31 0
93301906 return_main C Sept. 20, 2020, 5:06 a.m. OK GNU C++11 TESTS 68 31 0
93295027 li_z C Sept. 20, 2020, 2:37 a.m. OK GNU C++11 TESTS 68 31 0
93293572 HLJD_HappyGuy1290 C Sept. 20, 2020, 1:55 a.m. OK GNU C++11 TESTS 68 31 0
93292571 Mivik C Sept. 20, 2020, 1:24 a.m. OK GNU C++11 TESTS 68 31 0
93291238 onglu1 C Sept. 20, 2020, 12:27 a.m. OK GNU C++11 TESTS 68 31 0
93289299 Daniel_Jiang C Sept. 19, 2020, 10:56 p.m. OK GNU C++11 TESTS 68 31 0
93298984 Mr_Eight C Sept. 20, 2020, 4:08 a.m. OK GNU C++11 TESTS 68 31 0
93304448 kamleshbp C Sept. 20, 2020, 5:48 a.m. OK GNU C++14 TESTS 68 46 0
93305211 noobnoob5465 C Sept. 20, 2020, 5:59 a.m. OK GNU C++14 TESTS 68 46 0
93305058 prince_3855 C Sept. 20, 2020, 5:56 a.m. OK GNU C++14 TESTS 68 46 0
93304668 lightvishal C Sept. 20, 2020, 5:51 a.m. OK GNU C++14 TESTS 68 46 0
93303794 harsha99 C Sept. 20, 2020, 5:38 a.m. OK GNU C++14 TESTS 68 46 0
93302216 nimitha1jagadeesha C Sept. 20, 2020, 5:11 a.m. OK GNU C++14 TESTS 68 46 0
93301456 AakashKr C Sept. 20, 2020, 4:58 a.m. OK GNU C++14 TESTS 68 46 0
93301387 lakergo C Sept. 20, 2020, 4:57 a.m. OK GNU C++14 TESTS 68 46 0
93300341 vjudge2 C Sept. 20, 2020, 4:36 a.m. OK GNU C++14 TESTS 68 46 0
93297542 harryamneet600 C Sept. 20, 2020, 3:40 a.m. OK GNU C++14 TESTS 68 46 0
93305112 kelvin_0179 C Sept. 20, 2020, 5:57 a.m. OK GNU C++17 TESTS 68 46 0
93304525 aryan_312 C Sept. 20, 2020, 5:49 a.m. OK GNU C++17 TESTS 68 46 0
93304360 prabhAmbrose C Sept. 20, 2020, 5:46 a.m. OK GNU C++17 TESTS 68 46 0
93304186 ken.adams C Sept. 20, 2020, 5:44 a.m. OK GNU C++17 TESTS 68 46 0
93303603 _qiskit_ C Sept. 20, 2020, 5:35 a.m. OK GNU C++17 TESTS 68 46 0
93302278 The_Rhino C Sept. 20, 2020, 5:12 a.m. OK GNU C++17 TESTS 68 46 0
93301553 velu276 C Sept. 20, 2020, 5 a.m. OK GNU C++17 TESTS 68 46 0
93301353 sayankgp C Sept. 20, 2020, 4:56 a.m. OK GNU C++17 TESTS 68 46 0
93300714 ss04 C Sept. 20, 2020, 4:44 a.m. OK GNU C++17 TESTS 68 46 0
93305351 jibon_da_bedonar C Sept. 20, 2020, 6:01 a.m. OK GNU C++17 TESTS 68 46 0
93283498 Vaibhav_86 C Sept. 19, 2020, 8:24 p.m. OK GNU C++17 (64) TESTS 68 31 0
93268173 M0riarty C Sept. 19, 2020, 4:33 p.m. OK GNU C++17 (64) TESTS 68 31 307200
93303121 axat0081 C Sept. 20, 2020, 5:27 a.m. OK GNU C++17 (64) TESTS 68 31 3891200
93303808 silverfish C Sept. 20, 2020, 5:38 a.m. OK GNU C++17 (64) TESTS 68 46 0
93300082 qeraT_niddU_habsiM C Sept. 20, 2020, 4:31 a.m. OK GNU C++17 (64) TESTS 68 46 0
93296803 Smilyt_ C Sept. 20, 2020, 3:23 a.m. OK GNU C++17 (64) TESTS 68 46 0
93296593 Anachor C Sept. 20, 2020, 3:18 a.m. OK GNU C++17 (64) TESTS 68 46 0
93296239 Theofratus C Sept. 20, 2020, 3:09 a.m. OK GNU C++17 (64) TESTS 68 46 0
93294522 shibaka C Sept. 20, 2020, 2:23 a.m. OK GNU C++17 (64) TESTS 68 46 0
93304966 jaga__daku C Sept. 20, 2020, 5:55 a.m. OK GNU C++17 (64) TESTS 68 46 0
93284644 clyring C Sept. 19, 2020, 8:48 p.m. OK Haskell TESTS 68 217 102400
93280839 PratyushS7 C Sept. 19, 2020, 7:40 p.m. OK Java 11 TESTS 68 186 0
93304802 pgupta9830 C Sept. 20, 2020, 5:53 a.m. OK Java 11 TESTS 68 186 0
93282697 Akash_kunwar C Sept. 19, 2020, 8:09 p.m. OK Java 11 TESTS 68 187 0
93298662 sf14t C Sept. 20, 2020, 4:02 a.m. OK Java 11 TESTS 68 187 0
93276836 srjvastri8 C Sept. 19, 2020, 6:55 p.m. OK Java 11 TESTS 68 187 0
93267104 atishay127 C Sept. 19, 2020, 4:32 p.m. OK Java 11 TESTS 68 187 0
93281679 nikhilmishra1211 C Sept. 19, 2020, 7:53 p.m. OK Java 11 TESTS 68 202 0
93276425 SevenDeadlySins C Sept. 19, 2020, 6:51 p.m. OK Java 11 TESTS 68 202 0
93275925 Kimo_Fathy C Sept. 19, 2020, 6:47 p.m. OK Java 11 TESTS 68 202 0
93284674 aCitizen C Sept. 19, 2020, 8:48 p.m. OK Java 11 TESTS 68 202 0
93288095 Shemo C Sept. 19, 2020, 10:11 p.m. OK Java 8 TESTS 68 124 0
93285701 piyush33patel C Sept. 19, 2020, 9:12 p.m. OK Java 8 TESTS 68 124 0
93284729 R3KT C Sept. 19, 2020, 8:50 p.m. OK Java 8 TESTS 68 124 0
93279449 nandit C Sept. 19, 2020, 7:23 p.m. OK Java 8 TESTS 68 124 0
93278599 rational_fool C Sept. 19, 2020, 7:13 p.m. OK Java 8 TESTS 68 124 0
93276891 ragnarok001 C Sept. 19, 2020, 6:55 p.m. OK Java 8 TESTS 68 124 0
93274859 soumyab C Sept. 19, 2020, 6:39 p.m. OK Java 8 TESTS 68 124 0
93298833 Pranay2516 C Sept. 20, 2020, 4:06 a.m. OK Java 8 TESTS 68 124 0
93294407 nuchenghao C Sept. 20, 2020, 2:20 a.m. OK Java 8 TESTS 68 124 0
93288440 rachitpts.2454 C Sept. 19, 2020, 10:23 p.m. OK Java 8 TESTS 68 124 0
93298986 Spheniscine C Sept. 20, 2020, 4:08 a.m. OK Kotlin TESTS 68 156 1024000
93282668 IronArt C Sept. 19, 2020, 8:09 p.m. OK MS C++ 2017 TESTS 68 46 409600
93280629 exode4 C Sept. 19, 2020, 7:37 p.m. OK MS C++ 2017 TESTS 68 61 0
93268494 nortonlrc C Sept. 19, 2020, 4:34 p.m. OK MS C++ 2017 TESTS 68 93 0
93283726 Awa149 C Sept. 19, 2020, 8:28 p.m. OK MS C++ 2017 TESTS 68 93 0
93281664 ustaritz C Sept. 19, 2020, 7:53 p.m. OK MS C++ 2017 TESTS 68 93 204800
93265462 jdb0ss C Sept. 19, 2020, 4:29 p.m. OK MS C++ 2017 TESTS 68 108 0
93273206 modito C Sept. 19, 2020, 6:30 p.m. OK MS C++ 2017 TESTS 68 108 204800
93273347 Throder C Sept. 19, 2020, 6:31 p.m. OK MS C++ 2017 TESTS 68 109 0
93275786 fancy_lettuce C Sept. 19, 2020, 6:46 p.m. OK .NET Core C# TESTS 68 187 3993600
93276517 ngoc.ks C Sept. 19, 2020, 6:52 p.m. OK Node.js TESTS 68 109 5120000
93302988 bazzyadb C Sept. 20, 2020, 5:25 a.m. OK PyPy 2 TESTS 68 124 1126400
93286387 chaudhary_19 C Sept. 19, 2020, 9:26 p.m. OK PyPy 2 TESTS 68 140 3686400
93272799 snape_here C Sept. 19, 2020, 6:28 p.m. OK PyPy 2 TESTS 68 343 10956800
93278643 Shee11 C Sept. 19, 2020, 7:13 p.m. OK PyPy 3 TESTS 68 170 3481600
93272802 shadoX C Sept. 19, 2020, 6:28 p.m. OK PyPy 3 TESTS 68 171 2150400
93292705 a0976531005 C Sept. 20, 2020, 1:29 a.m. OK PyPy 3 TESTS 68 171 2662400
93287717 kaleabasfaw2010 C Sept. 19, 2020, 10 p.m. OK PyPy 3 TESTS 68 171 2969600
93279374 manish.17 C Sept. 19, 2020, 7:22 p.m. OK PyPy 3 TESTS 68 171 2969600
93278804 vaibhavsarda C Sept. 19, 2020, 7:15 p.m. OK PyPy 3 TESTS 68 187 4096000
93277233 yusinv C Sept. 19, 2020, 6:59 p.m. OK PyPy 3 TESTS 68 202 3891200
93272929 2019ucp1350 C Sept. 19, 2020, 6:29 p.m. OK PyPy 3 TESTS 68 202 3891200
93296292 nehan_der_thal C Sept. 20, 2020, 3:10 a.m. OK PyPy 3 TESTS 68 202 3993600
93287596 eenz C Sept. 19, 2020, 9:57 p.m. OK PyPy 3 TESTS 68 202 4096000
93302584 riimac_24 C Sept. 20, 2020, 5:18 a.m. OK Python 3 TESTS 68 124 921600
93303599 zuhaib786 C Sept. 20, 2020, 5:35 a.m. OK Python 3 TESTS 68 124 1228800
93279560 aakarsh C Sept. 19, 2020, 7:24 p.m. OK Python 3 TESTS 68 139 1024000
93276702 sh1194 C Sept. 19, 2020, 6:54 p.m. OK Python 3 TESTS 68 139 1126400
93295765 noisegain C Sept. 20, 2020, 2:56 a.m. OK Python 3 TESTS 68 140 921600
93276319 301_anky C Sept. 19, 2020, 6:51 p.m. OK Python 3 TESTS 68 140 1024000
93304007 andnyu C Sept. 20, 2020, 5:41 a.m. OK Python 3 TESTS 68 155 819200
93276703 code_stacker C Sept. 19, 2020, 6:54 p.m. OK Python 3 TESTS 68 155 1024000
93268541 SamLM10 C Sept. 19, 2020, 4:34 p.m. OK Python 3 TESTS 68 155 1024000
93305371 arvas C Sept. 20, 2020, 6:01 a.m. OK Python 3 TESTS 68 155 1126400
93274669 arturas C Sept. 19, 2020, 6:38 p.m. OK Rust TESTS 68 46 819200

remove filters

Back to search problems