| [ |
| { |
| "contest_date": "2025-04-06T00:00:00", |
| "difficulty": "hard", |
| "hidden_tests": [ |
| { |
| "input": "4564\n253140288 293305612 750791934 354530934 444237786 846682985 925663544 35056", |
| "output_len": 14 |
| }, |
| { |
| "input": "63\n55449 10966 48278 28854 34199 76708 21835 56522 25159 46992 15075 8370 92014 ", |
| "output_len": 8 |
| }, |
| { |
| "input": "52\n68827 19447 33671 78983 20435 49677 76409 38586 94127 92586 61661 8698 11095 ", |
| "output_len": 8 |
| } |
| ], |
| "problem_id": "arc196_a", |
| "public_tests": [ |
| { |
| "input": "4\n1 2 5 3", |
| "output": "5", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "7\n3 1 4 1 5 9 2", |
| "output": "14", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "5\n1 1 1 1 1", |
| "output": "0", |
| "testtype": "stdin" |
| } |
| ], |
| "source": "livecodebench/code_generation_lite:v6", |
| "starter_code": "", |
| "statement": "You are given a length-N sequence A = (A_1, A_2, \\ldots, A_N).\nYou will repeatedly perform the following operation until the sequence has length at most 1: choose two adjacent numbers and remove both from the sequence.\nThe score obtained in one operation is the absolute difference of the two chosen numbers.\nFind the maximum possible total score obtained.\n\nInput\n\nThe input is given from Standard Input in the following format:\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the maximum possible total score ob", |
| "title": "Adjacent Delete" |
| }, |
| { |
| "contest_date": "2025-03-22T00:00:00", |
| "difficulty": "hard", |
| "hidden_tests": [ |
| { |
| "input": "ZGBZMOLYGOLZUCBBPIAQVSSGHCYUYQWQNQJDENSNCDNCDNYEXAZONVNAPKXICLCDLWALLFAHLCTEGAGV", |
| "output_len": 166 |
| }, |
| { |
| "input": "UOMWVSNBMWSNYVWBFOCIWFOQPRTYABPKJOBZZNGRUCXEAMVNKAGAWYAVQTDGDTUG", |
| "output_len": 128 |
| }, |
| { |
| "input": "XCU", |
| "output_len": 6 |
| } |
| ], |
| "problem_id": "abc398_f", |
| "public_tests": [ |
| { |
| "input": "ABC", |
| "output": "ABCBA", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "Z", |
| "output": "Z", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "TREE", |
| "output": "TREERT", |
| "testtype": "stdin" |
| } |
| ], |
| "source": "livecodebench/code_generation_lite:v6", |
| "starter_code": "", |
| "statement": "Find one shortest palindrome that has S as its prefix.\n\nInput\n\nThe input is given from Standard Input in the following format:\nS\n\nOutput\n\nPrint the answer.\r\nIf multiple solutions exist, any of them is accepted.\n\nConstraints\n\n\n- S is a string of length between 1 and 500000, inclusive, consisting of uppercase English letters.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nABCBA\r\n\nABCBA is a shortest palindrome that has S= ABC as its prefix.\n\nSample Input 2\n\nZ\n\nSample Output 2\n\nZ\r\n\nZ is a shortest palindro", |
| "title": "ABCBA" |
| }, |
| { |
| "contest_date": "2025-04-05T00:00:00", |
| "difficulty": "easy", |
| "hidden_tests": [ |
| { |
| "input": "286", |
| "output_len": 3 |
| }, |
| { |
| "input": "20", |
| "output_len": 3 |
| }, |
| { |
| "input": "26", |
| "output_len": 3 |
| } |
| ], |
| "problem_id": "abc400_a", |
| "public_tests": [ |
| { |
| "input": "10", |
| "output": "40", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "11", |
| "output": "-1", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "400", |
| "output": "1", |
| "testtype": "stdin" |
| } |
| ], |
| "source": "livecodebench/code_generation_lite:v6", |
| "starter_code": "", |
| "statement": "In the ceremony commemorating ABC400, we want to arrange 400 people in a rectangular formation of A rows and B columns without any gaps.\nYou are given a positive integer A. Print the value of a positive integer B for which such an arrangement is possible. If there is no such positive integer B, print -1.\n\nInput\n\nThe input is given from Standard Input in the following format:\nA\n\nOutput\n\nPrint the value of B or -1 as specified by the problem statement.\n\nConstraints\n\n\n- A is an integer between 1 an", |
| "title": "ABC400 Party" |
| }, |
| { |
| "contest_date": "2025-04-06T00:00:00", |
| "difficulty": "hard", |
| "hidden_tests": [ |
| { |
| "input": "118\nWWWWBWBWWBWBWWWWWWWBWBWWBBBBBBBWBBWBBWBWBWBWBWWWBBBWBWBWBWWBWWWWWWBBWWBBWBWB", |
| "output_len": 2 |
| }, |
| { |
| "input": "108\nBBBWWBWBWWBWBBWWBWWBWBWWBWWWWBWWWBWBWBWWWBBWWWBBWWWBWBBBWWWWBBWBWBBBWBWWWBWB", |
| "output_len": 2 |
| }, |
| { |
| "input": "8\nWWBWBWWBWBBBWWBB", |
| "output_len": 2 |
| } |
| ], |
| "problem_id": "arc196_c", |
| "public_tests": [ |
| { |
| "input": "2\nBWBW", |
| "output": "1", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "4\nBWWBWBWB", |
| "output": "0", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "9\nBWWBWBBBWWBWBBWWBW", |
| "output": "240792", |
| "testtype": "stdin" |
| } |
| ], |
| "source": "livecodebench/code_generation_lite:v6", |
| "starter_code": "", |
| "statement": "There is a directed graph with 2N vertices and 2N-1 edges.\r\nThe vertices are numbered 1, 2, \\ldots, 2N, and the i-th edge is a directed edge from vertex i to vertex i+1.\nYou are given a length-2N string S = S_1 S_2 \\ldots S_{2N} consisting of N Ws and N Bs.\r\nVertex i is colored white if S_i is W, and black if S_i is B.\nYou will perform the following series of operations:\n\n- Partition the 2N vertices into N pairs, each consisting of one white vertex and one black vertex.\n- For each pair, add a di", |
| "title": "Strongly Connected" |
| }, |
| { |
| "contest_date": "2025-04-05T00:00:00", |
| "difficulty": "medium", |
| "hidden_tests": [ |
| { |
| "input": "2 2\n..\n..\n2 2 2 1", |
| "output_len": 2 |
| }, |
| { |
| "input": "8 5\n....#\n...#.\n.##.#\n###.#\n##...\n###.#\n.#..#\n.##..\n4 4 2 5", |
| "output_len": 2 |
| }, |
| { |
| "input": "6 4\n..##\n...#\n##..\n.#..\n..#.\n...#\n4 1 1 1", |
| "output_len": 2 |
| } |
| ], |
| "problem_id": "abc400_d", |
| "public_tests": [ |
| { |
| "input": "10 10\n..........\n#########.\n#.......#.\n#..####.#.\n##....#.#.\n#####.#.#.\n.##.#.#.#.\n###.#.#.#.\n###.#.#.#.\n#.....#...\n1 1 7 1", |
| "output": "1", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "2 2\n.#\n#.\n1 1 2 2", |
| "output": "1", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "1 3\n.#.\n1 1 1 3", |
| "output": "1", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "20 20\n####################\n##...##....###...###\n#.....#.....#.....##\n#..#..#..#..#..#..##\n#..#..#....##..#####\n#.....#.....#..#####\n#.....#..#..#..#..##\n#..#..#.....#.....##\n#..#..#....###...###\n####################\n####################\n##..#..##...###...##\n##..#..#.....#.....#\n##..#..#..#..#..#..#\n##..#..#..#..#..#..#\n##.....#..#..#..#..#\n###....#..#..#..#..#\n#####..#.....#.....#\n#####..##...###...##\n####################\n3 3 18 18", |
| "output": "3", |
| "testtype": "stdin" |
| } |
| ], |
| "source": "livecodebench/code_generation_lite:v6", |
| "starter_code": "", |
| "statement": "Takahashi is about to go buy eel at a fish shop.\nThe town where he lives is divided into a grid of H rows and W columns. Each cell is either a road or a wall.\r\nLet us denote the cell at the i-th row from the top (1\\leq i \\leq H) and the j-th column from the left (1\\leq j \\leq W) as cell (i,j).\r\nInformation about each cell is given by H strings S_1,S_2,\\ldots,S_H, each of length W. Specifically, if the j-th character of S_i (1\\leq i \\leq H,1\\leq j\\leq W) is ., cell (i,j) is a road; if it is #, ce", |
| "title": "Takahashi the Wall Breaker" |
| }, |
| { |
| "contest_date": "2025-03-22T00:00:00", |
| "difficulty": "hard", |
| "hidden_tests": [ |
| { |
| "input": "5 4\n1 2\n1 3\n1 4\n1 5", |
| "output_len": 10 |
| }, |
| { |
| "input": "128 2871\n1 68\n24 62\n13 107\n21 41\n6 89\n10 106\n24 88\n25 53\n21 44\n2 72\n2 95\n29 79\n1", |
| "output_len": 10 |
| }, |
| { |
| "input": "6 5\n1 6\n3 6\n2 6\n4 6\n5 6", |
| "output_len": 10 |
| } |
| ], |
| "problem_id": "abc398_g", |
| "public_tests": [ |
| { |
| "input": "4 3\n1 2\n2 3\n3 4", |
| "output": "Aoki", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "4 2\n1 2\n3 4", |
| "output": "Takahashi", |
| "testtype": "stdin" |
| }, |
| { |
| "input": "9 5\n2 9\n2 3\n4 6\n5 7\n1 8", |
| "output": "Aoki", |
| "testtype": "stdin" |
| } |
| ], |
| "source": "livecodebench/code_generation_lite:v6", |
| "starter_code": "", |
| "statement": "You are given a simple undirected graph with N vertices and M edges, with vertices labeled 1 to N and edges labeled 1 to M. The i-th edge connects vertices U_i and V_i. Initially, G does not contain an odd cycle.\nTakahashi and Aoki will play a game using this graph G. With Aoki going first, they take turns performing the following operation:\n\n- Choose a pair of integers (i,j) with 1 \\leq i < j \\leq N that satisfies both of the following conditions, then add an edge connecting vertices i and j to", |
| "title": "Not Only Tree Game" |
| } |
| ] |
|
|