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 |
|---|---|---|---|---|---|---|
| 628 | Educational Codeforces Round 8 | FINISHED | False | 7200 | 320597985 | Feb. 19, 2016, 3 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 963 ) | F | Bear and Fair Set | PROGRAMMING | flows | 2500 |
Limak is a grizzly bear. He is big and dreadful. You were chilling in the forest when you suddenly met him. It's very unfortunate for you. He will eat all your cookies unless you can demonstrate your mathematical skills. To test you, Limak is going to give you a puzzle to solve. It's a well-known fact that Limak, as every bear, owns a set of numbers. You know some information about the set: The elements of the set are distinct positive integers. The number of elements in the set is n . The number n is divisible by 5 . All elements are between 1 and b , inclusive: bears don't know numbers greater than b . For each r in {0, 1, 2, 3, 4} , the set contains exactly elements that give remainder r when divided by 5 . (That is, there are elements divisible by 5 , elements of the form 5 k + 1 , elements of the form 5 k + 2 , and so on.) Limak smiles mysteriously and gives you q hints about his set. The i -th hint is the following sentence: "If you only look at elements that are between 1 and upTo i , inclusive, you will find exactly quantity i such elements in my set." In a moment Limak will tell you the actual puzzle, but something doesn't seem right... That smile was very strange. You start to think about a possible reason. Maybe Limak cheated you? Or is he a fair grizzly bear? Given n , b , q and hints, check whether Limak can be fair, i.e. there exists at least one set satisfying the given conditions. If it's possible then print '' fair ". Otherwise, print '' unfair ". The first line contains three integers n , b and q ( 5 ≤ n ≤ b ≤ 10 4 , 1 ≤ q ≤ 10 4 , n divisible by 5 ) — the size of the set, the upper limit for numbers in the set and the number of hints. The next q lines describe the hints. The i -th of them contains two integers upTo i and quantity i ( 1 ≤ upTo i ≤ b , 0 ≤ quantity i ≤ n ). Print '' fair " if there exists at least one set that has all the required properties and matches all the given hints. Otherwise, print '' unfair ". In the first exampl |
| 43203 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 21766672 | returnzoo | F | Oct. 25, 2016, 8:42 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 102400 | 2500 | |
| 16327363 | Raindorous | F | Feb. 25, 2016, 11:32 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 204800 | 2500 | |
| 16430904 | biltharesatyendra | F | Feb. 29, 2016, 6:28 p.m. | OK | GNU C++ | TESTS | 34 | 15 | 307200 | 2500 | |
| 16303512 | wu6shen | F | Feb. 24, 2016, 5:49 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 307200 | 2500 | |
| 16303275 | wu6shen | F | Feb. 24, 2016, 5:22 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 307200 | 2500 | |
| 16279162 | chemthan | F | Feb. 22, 2016, 3:07 p.m. | OK | GNU C++ | TESTS | 34 | 15 | 307200 | 2500 | |
| 16226081 | abisheka | F | Feb. 20, 2016, 9:23 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 307200 | 2500 | |
| 18876048 | cheater2k | F | July 4, 2016, 3:43 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 409600 | 2500 | |
| 16322147 | wxy_z | F | Feb. 25, 2016, 7:39 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 409600 | 2500 | |
| 20883222 | Leefir | F | Sept. 24, 2016, 8:22 a.m. | OK | GNU C++ | TESTS | 34 | 15 | 716800 | 2500 | |
| 16454368 | zxcvbbvcxz | F | March 1, 2016, 9:21 p.m. | OK | GNU C++11 | TESTS | 34 | 15 | 102400 | 2500 | |
| 16293453 | garbageguy | F | Feb. 23, 2016, 1:48 p.m. | OK | GNU C++11 | TESTS | 34 | 15 | 102400 | 2500 | |
| 16219715 | matthew99 | F | Feb. 20, 2016, 3:17 a.m. | OK | GNU C++11 | TESTS | 34 | 15 | 102400 | 2500 | |
| 20431262 | atatomir | F | Sept. 7, 2016, 8:15 a.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 20418879 | atatomir | F | Sept. 6, 2016, 12:37 p.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 17333283 | waterfalls | F | April 16, 2016, 12:46 a.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 16794872 | Hec | F | March 18, 2016, 6:27 p.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 16222947 | Deathstar | F | Feb. 20, 2016, 5:48 a.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 16217013 | k0st1a | F | Feb. 19, 2016, 9:43 p.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 16205726 | bmerry | F | Feb. 19, 2016, 3:30 p.m. | OK | GNU C++11 | TESTS | 34 | 15 | 307200 | 2500 | |
| 27520175 | letsbe | F | June 2, 2017, 9:33 a.m. | OK | GNU C++14 | TESTS | 34 | 15 | 1433600 | 2500 | |
| 20711642 | myown1209 | F | Sept. 17, 2016, 3:44 p.m. | OK | GNU C++14 | TESTS | 34 | 15 | 1740800 | 2500 | |
| 35107206 | igand | F | Feb. 9, 2018, 10:39 p.m. | OK | GNU C++14 | TESTS | 34 | 15 | 1945600 | 2500 | |
| 35887615 | ______i______ | F | March 3, 2018, 2:07 p.m. | OK | GNU C++14 | TESTS | 34 | 15 | 2150400 | 2500 | |
| 35885852 | ______M______ | F | March 3, 2018, 1:37 p.m. | OK | GNU C++14 | TESTS | 34 | 15 | 2150400 | 2500 | |
| 30449732 | Perforator | F | Sept. 17, 2017, 8:35 p.m. | OK | GNU C++14 | TESTS | 34 | 15 | 2252800 | 2500 | |
| 23465697 | Ali.Pi | F | Dec. 31, 2016, 8:14 a.m. | OK | GNU C++14 | TESTS | 34 | 15 | 2252800 | 2500 | |
| 33446949 | SarvagyaAgarwal | F | Dec. 20, 2017, 6:36 a.m. | OK | GNU C++14 | TESTS | 34 | 15 | 5427200 | 2500 | |
| 26139065 | doubility | F | April 5, 2017, 9:07 a.m. | OK | GNU C++14 | TESTS | 34 | 15 | 6144000 | 2500 | |
| 25949460 | Kmcode | F | March 30, 2017, 11:04 a.m. | OK | GNU C++14 | TESTS | 34 | 15 | 6553600 | 2500 | |
| 59551090 | charlie_yan | F | Aug. 27, 2019, 3:01 a.m. | OK | GNU C++17 | TESTS | 34 | 30 | 102400 | 2500 | |
| 69807835 | ruo | F | Jan. 30, 2020, 2:53 a.m. | OK | GNU C++17 | TESTS | 34 | 30 | 2252800 | 2500 | |
| 42219538 | Benq | F | Aug. 28, 2018, 7:25 p.m. | OK | GNU C++17 | TESTS | 34 | 30 | 3174400 | 2500 | |
| 62914915 | ferin | F | Oct. 19, 2019, 8:25 a.m. | OK | GNU C++17 | TESTS | 34 | 30 | 5836800 | 2500 | |
| 57254808 | vjudge5 | F | July 18, 2019, 1:56 a.m. | OK | GNU C++17 | TESTS | 34 | 30 | 11776000 | 2500 | |
| 63968033 | aniket9465 | F | Nov. 1, 2019, 8 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 307200 | 2500 | |
| 44473214 | vjudge3 | F | Oct. 18, 2018, 7:26 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 307200 | 2500 | |
| 69808576 | ruo | F | Jan. 30, 2020, 3:16 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 409600 | 2500 | |
| 44473200 | mulambo | F | Oct. 18, 2018, 7:26 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 512000 | 2500 | |
| 57267527 | roll_no_1 | F | July 18, 2019, 7:42 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 1638400 | 2500 | |
| 16278526 | fmoraes | F | Feb. 22, 2016, 2:32 p.m. | OK | Java 8 | TESTS | 34 | 124 | 0 | 2500 | |
| 16226664 | dhrumil140396 | F | Feb. 20, 2016, 10:01 a.m. | OK | Java 8 | TESTS | 34 | 140 | 0 | 2500 | |
| 16209331 | Sumeet.Varma | F | Feb. 19, 2016, 4:18 p.m. | OK | Java 8 | TESTS | 34 | 140 | 0 | 2500 | |
| 31993729 | RP_9 | F | Nov. 2, 2017, 9:54 p.m. | OK | Java 8 | TESTS | 34 | 155 | 0 | 2500 | |
| 31993441 | RP_9 | F | Nov. 2, 2017, 9:36 p.m. | OK | Java 8 | TESTS | 34 | 187 | 0 | 2500 | |
| 57762039 | Taran_1407 | F | July 25, 2019, 6:24 p.m. | OK | Java 8 | TESTS | 34 | 233 | 0 | 2500 | |
| 44699206 | Ahmad | F | Oct. 22, 2018, 2:09 p.m. | OK | Java 8 | TESTS | 34 | 716 | 5939200 | 2500 | |
| 62672709 | Eva | F | Oct. 16, 2019, 10:23 a.m. | OK | Kotlin | TESTS | 34 | 124 | 0 | 2500 | |
| 16210559 | azukun | F | Feb. 19, 2016, 4:39 p.m. | OK | MS C# | TESTS | 34 | 171 | 12185600 | 2500 | |
| 23672219 | vjudge2 | F | Jan. 9, 2017, 11:44 p.m. | OK | MS C++ | TESTS | 34 | 15 | 5836800 | 2500 | |
| 16644651 | Roms | F | March 11, 2016, 7:56 a.m. | OK | MS C++ | TESTS | 34 | 46 | 33484800 | 2500 |
Back to search problems