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. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 300 ) | F | Design Tutorial: Change the Goal | PROGRAMMING | constructive algorithms math matrices | 2600 |
There are some tasks which have the following structure: you are given a model, and you can do some operations, you should use these operations to achive the goal. One way to create a new task is to use the same model and same operations, but change the goal. Let's have a try. I have created the following task for Topcoder SRM 557 Div1-Hard: you are given n integers x 1 , x 2 , ..., x n . You are allowed to perform the assignments (as many as you want) of the following form x i ^= x j (in the original task i and j must be different, but in this task we allow i to equal j ). The goal is to maximize the sum of all x i . Now we just change the goal. You are also given n integers y 1 , y 2 , ..., y n . You should make x 1 , x 2 , ..., x n exactly equal to y 1 , y 2 , ..., y n . In other words, for each i number x i should be equal to y i . The first line contains an integer n (1 ≤ n ≤ 10000) . The second line contains n integers: x 1 to x n (0 ≤ x i ≤ 10 9 ) . The third line contains n integers: y 1 to y n (0 ≤ y i ≤ 10 9 ) . If there is no solution, output -1 . If there is a solution, then in the first line output an integer m (0 ≤ m ≤ 1000000) – the number of assignments you need to perform. Then print m lines, each line should contain two integers i and j (1 ≤ i , j ≤ n ) , which denote assignment x i ^= x j . If there are multiple solutions you can print any of them. We can prove that under these constraints if there exists a solution then there always exists a solution with no more than 10 6 operations. Assignment a ^= b denotes assignment a = a ^ b , where operation " ^ " is bitwise XOR of two integers. |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 18979111 | DaibaNana | F | July 9, 2016, 4 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 5324800 | 2600 | |
| 13925827 | 130705009 | F | Oct. 29, 2015, 2:48 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 5324800 | 2600 | |
| 15143503 | HappyNewYearMike | F | Dec. 31, 2015, 11:21 p.m. | OK | GNU C++ | TESTS | 88 | 93 | 5529600 | 2600 | |
| 12599198 | bdep__ | F | Aug. 19, 2015, 7:58 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 5734400 | 2600 | |
| 10373672 | vjudge4 | F | March 21, 2015, 4:39 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 5836800 | 2600 | |
| 9612860 | wjh720 | F | Jan. 29, 2015, 9:01 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 5939200 | 2600 | |
| 17184960 | Chloe_fan | F | April 6, 2016, 11:09 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 7475200 | 2600 | |
| 17998799 | innv | F | May 20, 2016, 2:34 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 8704000 | 2600 | |
| 9612828 | wjh720 | F | Jan. 29, 2015, 8:57 a.m. | OK | GNU C++ | TESTS | 88 | 93 | 9113600 | 2600 | |
| 28522158 | zyding | F | July 13, 2017, 4:42 p.m. | OK | GNU C++ | TESTS | 88 | 93 | 10240000 | 2600 | |
| 9276916 | zld3794955 | F | Dec. 26, 2014, 3:05 p.m. | OK | GNU C++0x | TESTS | 88 | 93 | 5939200 | 2600 | |
| 10227302 | zyeric | F | March 10, 2015, 2:12 p.m. | OK | GNU C++0x | TESTS | 88 | 93 | 10547200 | 2600 | |
| 51279976 | SovietPower | F | March 14, 2019, 2:47 a.m. | OK | GNU C++11 | TESTS | 88 | 46 | 3174400 | 2600 | |
| 16725867 | joisino | F | March 15, 2016, 10:57 a.m. | OK | GNU C++11 | TESTS | 88 | 77 | 6656000 | 2600 | |
| 57888435 | lopare | F | July 28, 2019, 10:54 a.m. | OK | GNU C++11 | TESTS | 88 | 78 | 5324800 | 2600 | |
| 51835887 | georgerapeanu | F | March 25, 2019, 6:21 p.m. | OK | GNU C++11 | TESTS | 88 | 78 | 8908800 | 2600 | |
| 50685731 | luogu_bot1 | F | March 2, 2019, 1:34 p.m. | OK | GNU C++11 | TESTS | 88 | 93 | 5324800 | 2600 | |
| 39218733 | zhouyuyang | F | June 13, 2018, 2:06 p.m. | OK | GNU C++11 | TESTS | 88 | 93 | 5324800 | 2600 | |
| 22610523 | rajat1603 | F | Nov. 29, 2016, 9:05 p.m. | OK | GNU C++11 | TESTS | 88 | 93 | 5324800 | 2600 | |
| 11498781 | a00012025 | F | June 8, 2015, 2:13 p.m. | OK | GNU C++11 | TESTS | 88 | 93 | 5836800 | 2600 | |
| 40970608 | vjudge5 | F | July 30, 2018, 1:03 p.m. | OK | GNU C++11 | TESTS | 88 | 93 | 6553600 | 2600 | |
| 23517601 | Ragdoll | F | Jan. 3, 2017, 1:56 p.m. | OK | GNU C++11 | TESTS | 88 | 93 | 7475200 | 2600 | |
| 44245058 | vjudge3 | F | Oct. 13, 2018, 8:21 a.m. | OK | GNU C++14 | TESTS | 88 | 77 | 5939200 | 2600 | |
| 57289972 | megatron10599 | F | July 18, 2019, 4:14 p.m. | OK | GNU C++14 | TESTS | 88 | 78 | 5427200 | 2600 | |
| 35583428 | Dalgerok | F | Feb. 22, 2018, 8:53 p.m. | OK | GNU C++14 | TESTS | 88 | 78 | 7270400 | 2600 | |
| 57289875 | megatron10599 | F | July 18, 2019, 4:12 p.m. | OK | GNU C++14 | TESTS | 88 | 93 | 5427200 | 2600 | |
| 35583483 | Dalgerok | F | Feb. 22, 2018, 8:56 p.m. | OK | GNU C++14 | TESTS | 88 | 93 | 7270400 | 2600 | |
| 22423560 | SakurakoujiRuna | F | Nov. 23, 2016, 1:05 p.m. | OK | GNU C++14 | TESTS | 88 | 93 | 7782400 | 2600 | |
| 23515905 | Ali.Pi | F | Jan. 3, 2017, 12:08 p.m. | OK | GNU C++14 | TESTS | 88 | 93 | 8396800 | 2600 | |
| 68911355 | chocorusk | F | Jan. 16, 2020, 7:43 a.m. | OK | GNU C++14 | TESTS | 88 | 109 | 5939200 | 2600 | |
| 39737427 | omidazadi | F | June 28, 2018, 8:54 a.m. | OK | GNU C++14 | TESTS | 88 | 592 | 10854400 | 2600 | |
| 63915023 | hjk1030 | F | Oct. 31, 2019, 9:44 a.m. | OK | GNU C++17 | TESTS | 88 | 61 | 3379200 | 2600 | |
| 68102902 | xiaowuc1 | F | Jan. 3, 2020, 5 a.m. | OK | GNU C++17 | TESTS | 88 | 93 | 6041600 | 2600 | |
| 53917246 | Alexandr_TS | F | May 9, 2019, 3:43 p.m. | OK | GNU C++17 | TESTS | 88 | 108 | 8704000 | 2600 | |
| 60608856 | ruo | F | Sept. 15, 2019, 10:26 a.m. | OK | GNU C++17 | TESTS | 88 | 109 | 5324800 | 2600 | |
| 13110257 | yangxinthu | F | Sept. 20, 2015, 6:13 a.m. | OK | MS C++ | TESTS | 88 | 873 | 5324800 | 2600 | |
| 40476604 | Ali_Pi | F | July 17, 2018, 12:09 p.m. | OK | Python 2 | TESTS | 88 | 842 | 21708800 | 2600 |
Back to search problems