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 |
|---|---|---|---|---|---|---|
| 753 | Testing Round 13 | FINISHED | False | 4500 | 293403323 | Dec. 29, 2016, 9:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 396 ) | C | Interactive Bulls and Cows (Hard) | PROGRAMMING | brute force constructive algorithms interactive | 2400 |
The only difference from the previous problem is the constraint on the number of requests. In this problem your program should guess the answer doing at most 7 requests. This problem is a little bit unusual. Here you are to implement an interaction with a testing system. That means that you can make queries and get responses in the online mode. Please be sure to use the stream flushing operation after each query's output in order not to leave part of your output in some buffer. For example, in C++ you've got to use the fflush(stdout) function, in Java — call System.out.flush() , and in Pascal — flush(output) . Bulls and Cows (also known as Cows and Bulls or Pigs and Bulls or Bulls and Cleots) is an old code-breaking paper and pencil game for two players, predating the similar commercially marketed board game Mastermind. On a sheet of paper, the first player thinks a secret string. This string consists only of digits and has the length 4 . The digits in the string must be all different, no two or more equal digits are allowed. Then the second player tries to guess his opponent's string. For every guess the first player gives the number of matches. If the matching digits are on their right positions, they are "bulls", if on different positions, they are "cows". Thus a response is a pair of numbers — the number of "bulls" and the number of "cows". A try can contain equal digits. More formally, let's the secret string is s and the second player are trying to guess it with a string x . The number of "bulls" is a number of such positions i ( 1 ≤ i ≤ 4 ) where s i = x i . The number of "cows" is a number of such digits c that s contains c in the position i (i.e. s i = c ), x contains c , but x i ≠ c . For example, the secret string is " 0427 ", the opponent's try is " 0724 ", then the answer is 2 bulls and 2 cows (the bulls are "0" and "2", the cows are "4" and "7"). If the secret string is " 0123 ", the opponent's try is " 0330 ", then the answer |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 25138589 | mouse416 | C | March 2, 2017, 1:47 a.m. | OK | GNU C++ | TESTS | 402 | 15 | 2150400 | 2400 | |
| 25138690 | mouse416 | C | March 2, 2017, 1:59 a.m. | OK | GNU C++ | TESTS | 402 | 15 | 2457600 | 2400 | |
| 25138648 | mouse416 | C | March 2, 2017, 1:53 a.m. | OK | GNU C++ | TESTS | 402 | 15 | 2560000 | 2400 | |
| 32994333 | Zarxdy34 | C | Dec. 7, 2017, 7:30 a.m. | OK | GNU C++ | TESTS | 402 | 31 | 2150400 | 2400 | |
| 23418796 | WDMWHH | C | Dec. 30, 2016, 12:18 p.m. | OK | GNU C++ | TESTS | 402 | 31 | 2150400 | 2400 | |
| 36028849 | Alex_Bulany | C | March 6, 2018, 10:06 p.m. | OK | GNU C++ | TESTS | 402 | 31 | 2355200 | 2400 | |
| 24408584 | TheMagician | C | Feb. 3, 2017, 11:28 a.m. | OK | GNU C++ | TESTS | 402 | 31 | 2457600 | 2400 | |
| 23583591 | imAnik | C | Jan. 6, 2017, 10:58 a.m. | OK | GNU C++ | TESTS | 402 | 31 | 2560000 | 2400 | |
| 23397335 | Claris | C | Dec. 29, 2016, 11:12 a.m. | OK | GNU C++ | TESTS | 402 | 31 | 2560000 | 2400 | |
| 23419368 | WDMWHH | C | Dec. 30, 2016, 12:42 p.m. | OK | GNU C++ | TESTS | 402 | 46 | 2150400 | 2400 | |
| 25142060 | orangebird806 | C | March 2, 2017, 7:54 a.m. | OK | GNU C++11 | TESTS | 402 | 15 | 2150400 | 2400 | |
| 25162633 | 2015190026 | C | March 3, 2017, 4:43 a.m. | OK | GNU C++11 | TESTS | 402 | 15 | 2457600 | 2400 | |
| 23669820 | maximumSHOT | C | Jan. 9, 2017, 7:26 p.m. | OK | GNU C++11 | TESTS | 402 | 15 | 2457600 | 2400 | |
| 36064917 | OnlyVim | C | March 8, 2018, 8:39 a.m. | OK | GNU C++11 | TESTS | 402 | 30 | 2355200 | 2400 | |
| 57813206 | py_ultron | C | July 26, 2019, 6:23 p.m. | OK | GNU C++11 | TESTS | 402 | 31 | 409600 | 2400 | |
| 23406341 | 0xA28 | C | Dec. 29, 2016, 7:35 p.m. | OK | GNU C++11 | TESTS | 402 | 31 | 2150400 | 2400 | |
| 23555889 | Meowl | C | Jan. 5, 2017, 1:48 p.m. | OK | GNU C++11 | TESTS | 402 | 31 | 2355200 | 2400 | |
| 23835030 | stdwal | C | Jan. 15, 2017, 10:17 a.m. | OK | GNU C++11 | TESTS | 402 | 31 | 2457600 | 2400 | |
| 23512563 | ilia12345 | C | Jan. 3, 2017, 8:28 a.m. | OK | GNU C++11 | TESTS | 402 | 31 | 2457600 | 2400 | |
| 23468197 | mi_ | C | Dec. 31, 2016, 11:21 a.m. | OK | GNU C++11 | TESTS | 402 | 31 | 2457600 | 2400 | |
| 27317852 | YOULLNEVERWA | C | May 24, 2017, 10 a.m. | OK | GNU C++14 | TESTS | 402 | 15 | 409600 | 2400 | |
| 27316435 | YOULLNEVERWA | C | May 24, 2017, 8:04 a.m. | OK | GNU C++14 | TESTS | 402 | 15 | 409600 | 2400 | |
| 25232671 | knock_out | C | March 5, 2017, 4:48 a.m. | OK | GNU C++14 | TESTS | 402 | 15 | 2355200 | 2400 | |
| 25163558 | temp8154 | C | March 3, 2017, 6:21 a.m. | OK | GNU C++14 | TESTS | 402 | 15 | 2355200 | 2400 | |
| 25163331 | temp8154 | C | March 3, 2017, 6 a.m. | OK | GNU C++14 | TESTS | 402 | 15 | 2355200 | 2400 | |
| 25163095 | temp8154 | C | March 3, 2017, 5:37 a.m. | OK | GNU C++14 | TESTS | 402 | 15 | 2355200 | 2400 | |
| 23807730 | vjudge1 | C | Jan. 14, 2017, 2:07 p.m. | OK | GNU C++14 | TESTS | 402 | 15 | 2355200 | 2400 | |
| 33704314 | m.r.m | C | Dec. 28, 2017, 8:23 a.m. | OK | GNU C++14 | TESTS | 402 | 30 | 2150400 | 2400 | |
| 33704408 | Soroosh | C | Dec. 28, 2017, 8:29 a.m. | OK | GNU C++14 | TESTS | 402 | 30 | 2355200 | 2400 | |
| 27318590 | YOULLNEVERWA | C | May 24, 2017, 10:54 a.m. | OK | GNU C++14 | TESTS | 402 | 31 | 307200 | 2400 | |
| 52987446 | aata_gache_tota_pakhi | C | April 18, 2019, 7:37 p.m. | OK | GNU C++17 | TESTS | 402 | 31 | 409600 | 2400 | |
| 52987710 | aata_gache_tota_pakhi | C | April 18, 2019, 7:45 p.m. | OK | GNU C++17 | TESTS | 402 | 46 | 409600 | 2400 | |
| 52986765 | aata_gache_tota_pakhi | C | April 18, 2019, 7:17 p.m. | OK | GNU C++17 | TESTS | 402 | 46 | 409600 | 2400 | |
| 63684069 | Slaaava | C | Oct. 28, 2019, 9:25 p.m. | OK | GNU C++17 | TESTS | 402 | 62 | 409600 | 2400 | |
| 62589512 | zerotrac | C | Oct. 14, 2019, 8:19 p.m. | OK | GNU C++17 | TESTS | 402 | 77 | 512000 | 2400 | |
| 68090025 | Yuki726 | C | Jan. 2, 2020, 5:46 p.m. | OK | GNU C++17 | TESTS | 402 | 140 | 512000 | 2400 | |
| 56384065 | STommydx | C | July 1, 2019, 9:44 a.m. | OK | GNU C++17 | TESTS | 402 | 140 | 512000 | 2400 | |
| 52933638 | reverse_macro | C | April 18, 2019, 4:47 a.m. | OK | GNU C++17 | TESTS | 402 | 343 | 921600 | 2400 | |
| 49434830 | chinmay0906 | C | Feb. 3, 2019, 6:28 p.m. | OK | GNU C++17 | TESTS | 402 | 358 | 716800 | 2400 | |
| 53613032 | SpeedOfMagic | C | May 1, 2019, 2:09 p.m. | OK | GNU C++17 | TESTS | 402 | 717 | 716800 | 2400 | |
| 23518485 | di_halt | C | Jan. 3, 2017, 2:43 p.m. | OK | Java 8 | TESTS | 402 | 140 | 20582400 | 2400 | |
| 23397675 | iakovlev.zakhar | C | Dec. 29, 2016, 11:29 a.m. | OK | Java 8 | TESTS | 402 | 171 | 20582400 | 2400 | |
| 23455045 | JialinOuyang | C | Dec. 30, 2016, 6:55 p.m. | OK | Java 8 | TESTS | 402 | 514 | 20992000 | 2400 | |
| 23687245 | cosmist | C | Jan. 10, 2017, 7:52 p.m. | OK | Java 8 | TESTS | 402 | 607 | 21299200 | 2400 | |
| 23453938 | JialinOuyang | C | Dec. 30, 2016, 6:33 p.m. | OK | Java 8 | TESTS | 402 | 1216 | 20992000 | 2400 | |
| 23397757 | Khismet | C | Dec. 29, 2016, 11:33 a.m. | OK | Java 8 | TESTS | 402 | 1388 | 20992000 | 2400 | |
| 23395089 | uwi | C | Dec. 29, 2016, 9:42 a.m. | OK | Java 8 | TESTS | 402 | 1637 | 21094400 | 2400 | |
| 23405117 | IgorKoval | C | Dec. 29, 2016, 6:28 p.m. | OK | Java 8 | TESTS | 402 | 1809 | 174796800 | 2400 | |
| 23405215 | IgorKoval | C | Dec. 29, 2016, 6:33 p.m. | OK | Java 8 | TESTS | 402 | 1996 | 174796800 | 2400 | |
| 23471349 | og.kostya | C | Dec. 31, 2016, 2:50 p.m. | OK | MS C# | TESTS | 402 | 311 | 14336000 | 2400 | |
| 23416877 | AnatolyTolstobrov | C | Dec. 30, 2016, 10:14 a.m. | OK | MS C# | TESTS | 402 | 780 | 18022400 | 2400 | |
| 23685422 | 666qwerty | C | Jan. 10, 2017, 5:31 p.m. | OK | MS C++ | TESTS | 402 | 46 | 6553600 | 2400 | |
| 26066574 | Vadim | C | April 1, 2017, 11:58 p.m. | OK | MS C++ | TESTS | 402 | 608 | 3174400 | 2400 | |
| 23409985 | Andriy77 | C | Dec. 29, 2016, 9:53 p.m. | OK | MS C++ | TESTS | 402 | 639 | 3174400 | 2400 | |
| 26066688 | Vadim | C | April 2, 2017, 12:18 a.m. | OK | MS C++ | TESTS | 402 | 686 | 2867200 | 2400 | |
| 23399884 | cielavenir | C | Dec. 29, 2016, 1:29 p.m. | OK | Python 2 | TESTS | 402 | 623 | 5324800 | 2400 | |
| 23690574 | lala | C | Jan. 11, 2017, 3:30 a.m. | OK | Python 3 | TESTS | 402 | 436 | 5632000 | 2400 |
Back to search problems