Codeforces Round 273 (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
478 Codeforces Round 273 (Div. 2) FINISHED False 7200 318349199 Oct. 16, 2014, 3:40 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 221 ) E Wavy numbers PROGRAMMING brute force dfs and similar meet-in-the-middle sortings 2700

B'A wavy number is such positive integer that for any digit of its decimal representation except for the first one and the last one following condition holds: the digit is either strictly larger than both its adjacent digits or strictly less than both its adjacent digits. For example, numbers 35270, 102, 747, 20 and 3 are wavy and numbers 123, 1000 and 2212 are not. The task is to find the k-th smallest wavy number r that is divisible by n for the given integer values n and k. You are to write a program that will find the value of r if it doesn 't exceed 1014. The only line of input contains two integers n and k, separated by a single space (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891014). Your task is to output the only integer r -- the answer to the given problem. If such number does not exist or it is larger than 1014, then print "-1" (minus one without the quotes) instead. The values of the first four wavy numbers that are divisible by n for the first sample are: 492, 615, 738 and 1845.'...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
35874941 ______u______ E March 3, 2018, 8:03 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35874838 ______n______ E March 3, 2018, 8:02 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35874281 _____i_____ E March 3, 2018, 7:47 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35874249 _____k_____ E March 3, 2018, 7:46 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35870700 ______h______ E March 3, 2018, 6:34 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35870677 ______k______ E March 3, 2018, 6:34 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35870046 ______i______ E March 3, 2018, 6:22 a.m. OK GNU C++ TESTS 50 1045 90419200 2700
35862915 ______M______ E March 2, 2018, 10:35 p.m. OK GNU C++ TESTS 50 1045 90419200 2700
40987779 ReaLNero1 E July 30, 2018, 9:29 p.m. OK GNU C++11 TESTS 50 264 116531200 2700
52912302 georgerapeanu E April 17, 2019, 2:31 p.m. OK GNU C++11 TESTS 50 451 25190400 2700
57888169 lopare E July 28, 2019, 10:48 a.m. OK GNU C++11 TESTS 50 1029 88371200 2700
38947344 zhouyuyang E June 4, 2018, 2:19 p.m. OK GNU C++11 TESTS 50 1029 91852800 2700
57818772 py_ultron E July 26, 2019, 9:24 p.m. OK GNU C++11 TESTS 50 1045 88371200 2700
44019480 hetanglianyi E Oct. 9, 2018, 2:14 a.m. OK GNU C++11 TESTS 50 1341 29593600 2700
53091032 artur.socha E April 21, 2019, 11:13 a.m. OK GNU C++14 TESTS 50 1060 120217600 2700
48145097 DeadPillow E Jan. 9, 2019, 4:02 p.m. OK GNU C++14 TESTS 50 1247 257024000 2700
53090554 artur.socha E April 21, 2019, 11:01 a.m. OK GNU C++14 TESTS 50 1263 112640000 2700
52445880 Noam527 E April 7, 2019, 7:59 a.m. OK GNU C++14 TESTS 50 1434 164352000 2700
60911755 ruo E Sept. 20, 2019, 6:17 a.m. OK GNU C++17 TESTS 50 592 32051200 2700
52448205 almogwald E April 7, 2019, 8:44 a.m. OK GNU C++17 TESTS 50 857 180940800 2700
40891949 Gediminas E July 28, 2018, 4:38 p.m. OK GNU C++17 TESTS 50 873 201625600 2700
41064410 .__. E July 31, 2018, 6:04 p.m. OK GNU C++17 TESTS 50 1013 48947200 2700
66401175 hjk1030 E Dec. 6, 2019, 12:20 p.m. OK GNU C++17 TESTS 50 1029 264294400 2700

remove filters

Back to search problems