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.
Problems
B'You are given a complete bipartite graph with 2n nodes, with n nodes on each side of the bipartition. Nodes 1 through n are on one side of the bipartition, and nodes n+1 to 2n are on the other side. You are also given an n x n matrix a describing the edge weights. a_{ij} denotes the weight of the edge between nodes i and j+n . Each edge has a distinct weight. Alice and Bob are playing a game on this graph. First Alice chooses to play as either "increasing" or "decreasing" for herself, and Bob gets the other choice. Then she places a token on any node of the graph. Bob then moves the token along any edge incident to that node. They now take turns playing the following game, with Alice going first. The current player must move the token from the current vertex to some adjacent unvisited vertex. Let w be the last weight of the last edge that was traversed. The edge that is traversed must be strictly greater than w if the player is playing as "increasing", otherwise, it must be strictly less. The first player unable to make a move loses. You are given n and the edge weights of the graph. You can choose to play as either Alice or Bob, and you will play against the judge. You must win all the games for your answer to be judged correct. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 50 ). Description of the test cases follows. Each test starts with an integer n ( 1 <= q n <= q 50 ) -- the number of nodes on each side of the bipartition. The next n lines contain n integers a_{ij} ( 1 <= q a_{ij} <= q n^2 ). a_{ij} denotes the weight of the edge between node i and node j+n . All a_{ij} will be distinct. You first print a string "A" or "B", denoting which player you want to play ("A" for Alice and "B" for Bob). If playing as Alice, first print either "I" or'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
55654495 |
EncodeTalker |
F |
June 16, 2019, 4:25 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
46 |
0 |
|
3400 |
55610346 |
ReaLNero1 |
F |
June 16, 2019, 5:16 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
46 |
0 |
|
3400 |
54384378 |
Big_black_jujube |
F |
May 19, 2019, 12:31 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
46 |
102400 |
|
3400 |
54263763 |
luogu_bot2 |
F |
May 17, 2019, 4:19 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
62 |
102400 |
|
3400 |
54022288 |
ffffxk |
F |
May 12, 2019, 10:29 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
77 |
102400 |
|
3400 |
53810810 |
Rubbish12345 |
F |
May 6, 2019, 6:33 a.m. |
OK |
GNU C++11 |
TESTS |
33 |
77 |
102400 |
|
3400 |
57710389 |
py_ultron |
F |
July 24, 2019, 11:18 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
78 |
0 |
|
3400 |
53890281 |
newbiechdboom0 |
F |
May 8, 2019, 10:54 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
92 |
102400 |
|
3400 |
57866429 |
lopare |
F |
July 27, 2019, 9:22 p.m. |
OK |
GNU C++11 |
TESTS |
33 |
109 |
0 |
|
3400 |
58706154 |
luogu_bot3 |
F |
Aug. 13, 2019, 9:43 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
93 |
204800 |
|
3400 |
69555552 |
vjudge5 |
F |
Jan. 26, 2020, 8:40 a.m. |
OK |
GNU C++14 |
TESTS |
33 |
108 |
5120000 |
|
3400 |
66507206 |
lqs2015 |
F |
Dec. 8, 2019, 2:54 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
109 |
0 |
|
3400 |
53961961 |
vjudge4 |
F |
May 10, 2019, 2:42 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
109 |
204800 |
|
3400 |
53819510 |
ertebe11 |
F |
May 6, 2019, 12:24 p.m. |
OK |
GNU C++14 |
TESTS |
33 |
171 |
204800 |
|
3400 |
64073627 |
Shayan.P |
F |
Nov. 2, 2019, 8:12 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
92 |
204800 |
|
3400 |
69832327 |
vjudge1 |
F |
Jan. 30, 2020, 10:54 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
93 |
102400 |
|
3400 |
54724792 |
m1sch3f |
F |
May 27, 2019, 7:37 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
93 |
204800 |
|
3400 |
53858096 |
pmnox |
F |
May 7, 2019, 5:42 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
93 |
204800 |
|
3400 |
69601957 |
gongsuidashen |
F |
Jan. 27, 2020, 8:04 a.m. |
OK |
GNU C++17 |
TESTS |
33 |
109 |
0 |
|
3400 |
62576053 |
ak_taniya |
F |
Oct. 14, 2019, 3:56 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
109 |
0 |
|
3400 |
53858069 |
pmnox |
F |
May 7, 2019, 5:41 p.m. |
OK |
GNU C++17 |
TESTS |
33 |
109 |
204800 |
|
3400 |
53817049 |
Jeel_Vaishnav |
F |
May 6, 2019, 11:12 a.m. |
OK |
Java 8 |
TESTS |
33 |
265 |
0 |
|
3400 |
55806231 |
guillermo_sz |
F |
June 19, 2019, 10:43 p.m. |
OK |
Java 8 |
TESTS |
33 |
280 |
0 |
|
3400 |
53817091 |
Jeel_Vaishnav |
F |
May 6, 2019, 11:13 a.m. |
OK |
Java 8 |
TESTS |
33 |
280 |
0 |
|
3400 |
54422261 |
Megalitum |
F |
May 20, 2019, 4:10 p.m. |
OK |
MS C++ 2017 |
TESTS |
33 |
202 |
102400 |
|
3400 |
remove filters
Back to search problems