Codeforces Round 861 (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
1808 Codeforces Round 861 (Div. 2) FINISHED False 7200 51742499 March 29, 2023, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3853 ) C Unlucky Numbers PROGRAMMING brute force greedy implementation 1900

B"In this problem, unlike problem A, you need to look for unluckiest number, not the luckiest one. Note that the constraints of this problem differ from such in problem A. Olympus City recently launched the production of personal starships. Now everyone on Mars can buy one and fly to other planets inexpensively. Each starship has a number --some positive integer x . Let's define the luckiness of a number x as the difference between the largest and smallest digits of that number. For example, 142857 has 8 as its largest digit and 1 as its smallest digit, so its luckiness is 8-1=7 . And the number 111 has all digits equal to 1 , so its luckiness is zero. Hateehc is a famous Martian blogger who often flies to different corners of the solar system. To release interesting videos even faster, he decided to buy himself a starship. When he came to the store, he saw starships with numbers from l to r inclusively. While in the store, Hateehc wanted to find a starship with the unluckiest number. Since there are a lot of starships in the store, and Hateehc can't program, you have to help the blogger and write a program that answers his question. The first line contains an integer t ( 1 <= t <= 600 ) --the number of test cases. Each of the following t lines contains a description of the test case. The description consists of two integers l , r ( 1 <= l <= r <= 10^{18} ) -- the largest and smallest numbers of the starships in the store. Print t lines, one line for each test case, containing the unluckiest starship number in the store. If there are several ways to choose the unluckiest number, output any of them. Let's look at two test examples: In the fifth test case, the unluckiest numbers are 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 11 , 22 , 33 , 44 , 55 , 66 , 77 , 88 , 99 , so yo"...

Tutorials

Codeforces Round #861 (Div. 2) editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
199952370 ZhiGeBaiShui C March 31, 2023, 1:47 p.m. OK Clang++20 Diagnostics TESTS 27 77 0 1900
199952507 ZhiGeBaiShui C March 31, 2023, 1:48 p.m. OK GNU C++14 TESTS 27 15 0 1900
199821416 robinyqc C March 30, 2023, 12:22 p.m. OK GNU C++14 TESTS 27 15 0 1900
199821163 robinyqc C March 30, 2023, 12:19 p.m. OK GNU C++14 TESTS 27 15 0 1900
199820889 robinyqc C March 30, 2023, 12:17 p.m. OK GNU C++14 TESTS 27 15 0 1900
199804615 768 C March 30, 2023, 9:42 a.m. OK GNU C++14 TESTS 27 15 0 1900
199797908 atroxkid C March 30, 2023, 8:28 a.m. OK GNU C++14 TESTS 27 15 0 1900
199776798 FishAndCat C March 30, 2023, 3:26 a.m. OK GNU C++14 TESTS 27 15 0 1900
199770049 Leasier C March 30, 2023, 12:56 a.m. OK GNU C++14 TESTS 27 15 0 1900
200014367 Sunlight9 C March 31, 2023, 4:24 p.m. OK GNU C++14 TESTS 27 15 102400 1900
199923474 Syf2020 C March 31, 2023, 8:49 a.m. OK GNU C++14 TESTS 27 15 102400 1900
200002722 chappy1 C March 31, 2023, 3:53 p.m. OK GNU C++17 TESTS 27 15 0 1900
199957219 Euphoria_07 C March 31, 2023, 2:32 p.m. OK GNU C++17 TESTS 27 15 0 1900
199957161 Alone_but_mast_07 C March 31, 2023, 2:31 p.m. OK GNU C++17 TESTS 27 15 0 1900
199954242 wx13479893646 C March 31, 2023, 2:03 p.m. OK GNU C++17 TESTS 27 15 0 1900
199939353 wx13479893646 C March 31, 2023, 11:39 a.m. OK GNU C++17 TESTS 27 15 0 1900
199916891 CCSU_LRF C March 31, 2023, 7:25 a.m. OK GNU C++17 TESTS 27 15 0 1900
199878744 La_Croqueta C March 30, 2023, 8:11 p.m. OK GNU C++17 TESTS 27 15 0 1900
199833038 CyberDog C March 30, 2023, 1:56 p.m. OK GNU C++17 TESTS 27 15 0 1900
199819303 chunzhifeng C March 30, 2023, 12:03 p.m. OK GNU C++17 TESTS 27 15 0 1900
199818281 errormakers C March 30, 2023, 11:54 a.m. OK GNU C++17 TESTS 27 15 0 1900
200038558 alwyn C March 31, 2023, 7:19 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
200038400 alwyn C March 31, 2023, 7:17 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
200034476 speedyArda C March 31, 2023, 6:35 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199955759 AkramElOmrani C March 31, 2023, 2:18 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199954233 GudeGude C March 31, 2023, 2:03 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199949510 jiangnanmost C March 31, 2023, 1:16 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199948225 c20230437 C March 31, 2023, 1:04 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199943533 ggboyy C March 31, 2023, 12:19 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199943471 ggboyy C March 31, 2023, 12:19 p.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199938786 ggboyy C March 31, 2023, 11:34 a.m. OK GNU C++17 (64) TESTS 27 15 0 1900
199945369 Liuf C March 31, 2023, 12:37 p.m. OK GNU C++20 (64) TESTS 27 0 0 1900
199883270 ScorpioDagger C March 30, 2023, 8:57 p.m. OK GNU C++20 (64) TESTS 27 0 0 1900
199797547 Bellalabella C March 30, 2023, 8:23 a.m. OK GNU C++20 (64) TESTS 27 0 0 1900
199789263 mrsuns C March 30, 2023, 6:45 a.m. OK GNU C++20 (64) TESTS 27 0 0 1900
199786580 UUUnmei C March 30, 2023, 6:12 a.m. OK GNU C++20 (64) TESTS 27 0 0 1900
199765624 Bellman_Bored C March 29, 2023, 11:16 p.m. OK GNU C++20 (64) TESTS 27 0 0 1900
200079567 shashwat._.24 C April 1, 2023, 5:58 a.m. OK GNU C++20 (64) TESTS 27 15 0 1900
200076366 liang302 C April 1, 2023, 5:23 a.m. OK GNU C++20 (64) TESTS 27 15 0 1900
200075133 wa_maker C April 1, 2023, 5:08 a.m. OK GNU C++20 (64) TESTS 27 15 0 1900
200061829 zwu2020015020 C April 1, 2023, 1:37 a.m. OK GNU C++20 (64) TESTS 27 15 0 1900
199781099 manchik C March 30, 2023, 4:48 a.m. OK Go TESTS 27 31 102400 1900
199792514 harsh.awasthi C March 30, 2023, 7:22 a.m. OK Go TESTS 27 31 204800 1900
199750867 liangjiahui11 C March 29, 2023, 7:53 p.m. OK Go TESTS 27 31 204800 1900
199739759 4mda4mda C March 29, 2023, 5:48 p.m. OK Java 11 TESTS 27 202 0 1900
199922659 wdjuruo C March 31, 2023, 8:40 a.m. OK Java 11 TESTS 27 233 819200 1900
199913388 wdjuruo C March 31, 2023, 6:38 a.m. OK Java 11 TESTS 27 296 1536000 1900
199778137 Java_Programmer C March 30, 2023, 3:53 a.m. OK Java 11 TESTS 27 405 0 1900
199781008 the_unseen C March 30, 2023, 4:47 a.m. OK Java 11 TESTS 27 779 0 1900
199839148 vankamamidi_dheeraj C March 30, 2023, 2:32 p.m. OK Java 17 TESTS 27 187 614400 1900
200021357 imprayas12 C March 31, 2023, 5:02 p.m. OK Java 17 TESTS 27 482 307200 1900
199922909 wdjuruo C March 31, 2023, 8:43 a.m. OK Java 8 TESTS 27 109 0 1900
199787206 jhy0117 C March 30, 2023, 6:20 a.m. OK Java 8 TESTS 27 155 0 1900
199811620 -crazy_coder- C March 30, 2023, 10:54 a.m. OK Java 8 TESTS 27 529 0 1900
199837603 bandiaoz C March 30, 2023, 2:23 p.m. OK PyPy 3 TESTS 27 420 9318400 1900
199838161 bandiaoz C March 30, 2023, 2:26 p.m. OK PyPy 3 TESTS 27 436 9728000 1900
199922731 try1111111 C March 31, 2023, 8:41 a.m. OK PyPy 3-64 TESTS 27 124 3788800 1900
199920825 try1111111 C March 31, 2023, 8:19 a.m. OK PyPy 3-64 TESTS 27 124 3788800 1900
199773612 bronze_coder C March 30, 2023, 2:17 a.m. OK PyPy 3-64 TESTS 27 139 8704000 1900
199837041 InariInDream C March 30, 2023, 2:19 p.m. OK PyPy 3-64 TESTS 27 140 6656000 1900
199835829 ipip C March 30, 2023, 2:13 p.m. OK PyPy 3-64 TESTS 27 140 6656000 1900
199812048 AyuAnchor C March 30, 2023, 10:58 a.m. OK PyPy 3-64 TESTS 27 140 6656000 1900
199821097 Mayank_Bad C March 30, 2023, 12:19 p.m. OK PyPy 3-64 TESTS 27 140 7065600 1900
199766083 RobinFromTheHood C March 29, 2023, 11:25 p.m. OK PyPy 3-64 TESTS 27 155 5427200 1900
199761875 t0mmyn C March 29, 2023, 10:05 p.m. OK PyPy 3-64 TESTS 27 155 6656000 1900
199858167 Nneax_ C March 30, 2023, 4:39 p.m. OK PyPy 3-64 TESTS 27 170 8806400 1900
199759573 PythonIsGodlike C March 29, 2023, 9:30 p.m. OK Python 3 TESTS 27 233 0 1900
199855686 meohenbk C March 30, 2023, 4:18 p.m. OK Python 3 TESTS 27 296 102400 1900
199858599 meohenbk C March 30, 2023, 4:43 p.m. OK Python 3 TESTS 27 327 102400 1900
199936898 pennymagic156 C March 31, 2023, 11:17 a.m. OK Python 3 TESTS 27 467 0 1900
199937208 radhikapenikalapati123 C March 31, 2023, 11:19 a.m. OK Python 3 TESTS 27 483 0 1900
200027494 tariq05 C March 31, 2023, 5:34 p.m. OK Python 3 TESTS 27 655 0 1900
199863791 PranavBadBoy C March 30, 2023, 5:25 p.m. OK Python 3 TESTS 27 685 0 1900
200027896 tariq05 C March 31, 2023, 5:37 p.m. OK Python 3 TESTS 27 748 0 1900
200077909 Chromefish C April 1, 2023, 5:40 a.m. OK Python 3 TESTS 27 982 0 1900
199772154 liut C March 30, 2023, 1:45 a.m. OK Rust 2021 TESTS 27 15 0 1900

remove filters

Back to search problems