Codeforces Round 270

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
472 Codeforces Round 270 FINISHED False 9000 364487123 Sept. 28, 2014, 3:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 138 ) E Design Tutorial: Learn from a Game PROGRAMMING constructive algorithms implementation 2700

One way to create task is to learn from game. You should pick a game and focus on part of the mechanic of that game, then it might be a good task. Let's have a try. Puzzle and Dragon was a popular game in Japan, we focus on the puzzle part of that game, it is a tile-matching puzzle. There is an n × m board which consists of orbs. During the game you can do the following move. In the beginning of move you touch a cell of the board, then you can move your finger to one of the adjacent cells (a cell not on the boundary has 8 adjacent cells), then you can move your finger from the current cell to one of the adjacent cells one more time, and so on. Each time you move your finger from a cell to another cell, the orbs in these cells swap with each other. In other words whatever move you make, the orb in the cell you are touching never changes. The goal is to achieve such kind of pattern that the orbs will be cancelled and your monster will attack the enemy, but we don't care about these details. Instead, we will give you the initial board as an input and the target board as an output. Your goal is to determine whether there is a way to reach the target in a single move. The first line contains two integers: n and m (1 ≤ n , m ≤ 30) . The next n lines each contains m integers — the description of the initial board. The j -th integer in the i -th line is s i , j (1 ≤ s i , j ≤ 900) , where s i , j denotes the type of the orb located in the i -th row and j -th column of the board. The next n lines contain the target board in the same format. Note, that the initial board and the target board will be different. If there is no solution, then output: -1 . If there is a solution, then in the first line output an integer k (1 ≤ k ≤ 10 6 ) — the number of finger moves. In the next line print two integers x 0 and y 0 (1 ≤ x 0 ≤ n ; 1 ≤ y 0 ≤ m ) — the position of the cell you touch at the beginning. In each of the next k lines print two integers x i and y i (1 ≤ x i ≤ n ; 1

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
10762801 waterfalls E April 18, 2015, 12:38 a.m. OK GNU C++ TESTS 39 15 409600 2700
10762798 waterfalls E April 18, 2015, 12:37 a.m. OK GNU C++ TESTS 39 15 409600 2700
26170554 Manchery E April 6, 2017, 12:56 p.m. OK GNU C++ TESTS 39 30 2662400 2700
40987851 ReaLNero1 E July 30, 2018, 9:32 p.m. OK GNU C++ TESTS 39 31 409600 2700
12586397 bdep__ E Aug. 18, 2015, 9:05 a.m. OK GNU C++ TESTS 39 31 1126400 2700
11279760 Athee E May 26, 2015, 2:13 p.m. OK GNU C++ TESTS 39 46 512000 2700
9267764 zld3794955 E Dec. 25, 2014, 1:17 p.m. OK GNU C++ TESTS 39 46 7987200 2700
9378754 lnsuyn E Jan. 7, 2015, 12:02 p.m. OK GNU C++ TESTS 39 46 8089600 2700
15144038 HappyNewYearMike E Jan. 1, 2016, 12:03 a.m. OK GNU C++ TESTS 39 108 7884800 2700
11086398 yts1999 E May 13, 2015, 8:13 a.m. OK GNU C++ TESTS 39 108 8089600 2700
9378758 ntu_vjudge_2 E Jan. 7, 2015, 12:02 p.m. OK GNU C++0x TESTS 39 31 8089600 2700
9539237 ntu_vjudge_1 E Jan. 24, 2015, 2:37 p.m. OK GNU C++0x TESTS 39 61 7987200 2700
9539222 ntu_vjudge_1 E Jan. 24, 2015, 2:36 p.m. OK GNU C++0x TESTS 39 77 7987200 2700
9539230 ntu_vjudge_2 E Jan. 24, 2015, 2:37 p.m. OK GNU C++0x TESTS 39 93 7987200 2700
9539217 ntu_vjudge_2 E Jan. 24, 2015, 2:36 p.m. OK GNU C++0x TESTS 39 93 7987200 2700
9539243 ntu_vjudge_1 E Jan. 24, 2015, 2:38 p.m. OK GNU C++0x TESTS 39 109 7987200 2700
11490059 a00012025 E June 7, 2015, 4:46 p.m. OK GNU C++11 TESTS 39 30 1126400 2700
18726691 knightL E June 25, 2016, 10:19 p.m. OK GNU C++11 TESTS 39 31 1024000 2700
11490323 a00012025 E June 7, 2015, 5:19 p.m. OK GNU C++11 TESTS 39 31 1024000 2700
42995772 zhouyuyang E Sept. 17, 2018, noon OK GNU C++11 TESTS 39 31 1126400 2700
11490400 a00012025 E June 7, 2015, 5:27 p.m. OK GNU C++11 TESTS 39 31 1126400 2700
56696839 xht37 E July 8, 2019, 7:25 a.m. OK GNU C++11 TESTS 39 31 10547200 2700
11489957 a00012025 E June 7, 2015, 4:34 p.m. OK GNU C++11 TESTS 39 46 2150400 2700
11489620 a00012025 E June 7, 2015, 3:57 p.m. OK GNU C++11 TESTS 39 46 2355200 2700
56697826 xht37 E July 8, 2019, 7:50 a.m. OK GNU C++11 TESTS 39 46 10547200 2700
15967205 fsps60312 E Feb. 12, 2016, 7:52 a.m. OK GNU C++11 TESTS 39 62 512000 2700
20413777 data_h E Sept. 6, 2016, 7:20 a.m. OK GNU C++14 TESTS 39 46 1433600 2700
20414998 data_h E Sept. 6, 2016, 8:38 a.m. OK GNU C++14 TESTS 39 46 1638400 2700
23409885 Ali.Pi E Dec. 29, 2016, 9:43 p.m. OK GNU C++14 TESTS 39 46 3584000 2700
60515212 ruo E Sept. 14, 2019, 6:11 a.m. OK GNU C++17 TESTS 39 31 10240000 2700
63706457 ffao E Oct. 29, 2019, 8:34 a.m. OK GNU C++17 TESTS 39 233 12800000 2700
40476502 Ali_Pi E July 17, 2018, 12:06 p.m. OK Python 2 TESTS 39 327 2867200 2700
55825293 totsamyzed E June 20, 2019, 10:34 a.m. OK Python 3 TESTS 39 389 3276800 2700

remove filters

Back to search problems