messages listlengths 1 1 | ground_truth stringlengths 116 15.7M | dataset stringclasses 1
value | id stringlengths 6 8 |
|---|---|---|---|
[
{
"content": "You are given a string S.\r\nFind the maximum length of a contiguous substring of S that is a palindrome.\r\nNote that there is always a contiguous substring of S that is a palindrome.\n\nInput\n\nThe input is given from Standard Input in the following format:\nS\n\nOutput\n\nPrint the answer.\n\n... | eJy1VMmuHTUQfRLDdzzddYQSCERk5+l6as9TlSEfkE1gkawQEh8Bf8sCd/PCi24jRUik2irbx8euatvHv33+x2df3h0Gf35xd/fDL5fXb35+9/by8v5SA4ZKfnxzeXJ/+end2wf02wX8+uT+Ax6hjIurvCU+OxP/sRP36YmMhgMwZqpMV3o1xjXBqYoFS1SUi+aMWXjqueaSrxOnhMyY77dLf/39aemGYyK22bAdbq7eXL6tauzIXsbh9sE1hDsfET++GdNYheC4A1TbkLErX8E7ZYohV4dQKhsDhNM6ms7UHNT0WSqVXorBWJZzuw1y... | code_stdio | abc320_b |
[
{
"content": "Given integers N and M, compute the sum \\displaystyle \\sum_{k=0}^{N} \\rm{popcount}(k \\mathbin{\\&} M), modulo 998244353.\nHere, \\mathbin{\\&} represents the bitwise \\rm{AND} operation.\nWhat is the bitwise \\rm{AND} operation?\r\nThe result x = a \\mathbin{\\&} b of the bitwise \\rm{AND} ope... | eJytVkuKFEEUdOHCYyS9HuT9P3OSAfUAbkYXMysRPMR4KHceyagGQfqlUIJNVVMUmS8jI+JF1rfX33++eXX9PfzAw7svl4+Pn5+fLvfrYkvfP17u1uXT89PvV3jx9W79MYgW3Q6iMYjZpYWdLCjKotPX5t1YrTubq2fB0AjXSibCP64z5RxjI8zmJqwI87NVvMOFKs7UK0tpk5r1hLjMKyRDqlWjVnVR8XFpoaZG3pZLSmGK1knf4tvBvOGYMyu7vERZjVrOSNMdTcKlCaCluBdASGH70rhN0lPG8oFNCF85ufXDwLpZ1LydQalXsUW6... | code_stdio | abc356_d |
[
{
"content": "A string S consisting of lowercase English letters is a good string if and only if it satisfies the following property for all integers i not less than 1:\n\n- There are exactly zero or exactly two different letters that appear exactly i times in S.\n\nGiven a string S, determine if it is a good s... | eJy1VEuOEzEUZIHENUZZjzgAG3YsWYOAhT/PGXfadnv649gIiUPAfalyZwABi95gx+9XVS+d9lO+Pv/+5sWzvt69RvDh88nHaV1Or+5OJoUg0QjM8jGe7u9OaV1u2HuZUfpyf/cbX6uI/SfzbfqLqPSRdtuWuNOStm3ZuFJK2wKzLhsDhOSsBFYEW68CRAJPNoTwxNZ17XoiR769WTs32+wCv8xtgV8a9mwXpG0BCrCXum0zHGNoGhmoQYi0zR0jbYaqY0eeoFafvPG+H+9X7yuWrwa/tq4+ITbETPI1mco6cV/9Wo3nxydjdlXyrKfO... | code_stdio | abc349_b |
[
{
"content": "You are given a string S consisting of lowercase English letters.\r\nRemove all occurrences of a, e, i, o, u from S and print the resulting string.\nS contains at least one character other than a, e, i, o, u.\n\nInput\n\nThe input is given from Standard Input in the following format:\nS\n\nOutput\... | eJy9lEmuEzEQhlkgzvGUHRLiAJwECVh4nsf2jJA4BNyX6k7QS9KsKUVqp1z//5Xddv98+/v9uzdHfL7A4Mv3i/KxlsunlwsqJFCWv/rLh5dLqOWWLoTuuR8fXu5qx1zPddfUYxmCwBAE4rn+Lv8oSs+V6YwfSgaZo7OhITdrL87HrS2ZE/VJK2dJKaicWhzyEDU3nxSHoJw4eLTBWWyEo46sNzIrGZvoAfUssB5IpVi6EKVnj6T3Sq1+WufusVv0w+DQX9WvWpAewqfdU6EqFZhCAVWGGKsIMVUZZGtV8EAKIajYJ4LCMAIBQ5CuYU8h... | code_stdio | abc315_a |
[
{
"content": "You are given a string S consisting of lowercase English letters and the character ..\r\nPrint the last substring when S is split by .s.\r\nIn other words, print the longest suffix of S that does not contain ..\n\nInput\n\nThe input is given from Standard Input in the following format:\nS\n\nOutpu... | eJy9VEuuHTUQZYDEAjJj9HTHUS2AlSABA//a///fUaQsAvaL+z5IeN0SCAnigbts16k6farsT9/+9v133zzHj++28dOHh3ShlscPLw9UiKcsgQo/u8f7l4ev5Y+T587H9y9/cS4JuWxQYcC954YB8fYKe916i4N19Vp3n8+jjHJ1f916C0iqkaIGx6iKyWHoo9Ur7s/NayoOgLWgUMmZsJ7TtswVbm5QCmlu5wFOANck1AUigQeQGIBB5s3reIYa28sB0GtIegu5JGN4Vhg2j9oXMINqkjy5UYIVCqnZe50cU2mq78WnETXoa1x9i7sZ... | code_stdio | abc339_a |
[
{
"content": "There are N people labeled 1 to N, who have played several one-on-one games without draws. Initially, each person started with 0 points. In each game, the winner's score increased by 1 and the loser's score decreased by 1 (scores can become negative). Determine the final score of person N if the f... | eJztlTuOFEEQRDFwuEVq7C1U/w8nQWI4AM6AsWshJA4BBh5H5UVWr4SmL4DErmZ6e6ryG5UR9f31z99vXvnf+1+8fPh6+XT78vR4eWeXer0lC9lCut4uD3b5/PR47GQWvj3YX7bleosW7+3iya4TM1qOVqLVaO3kElI7e612vdVly0KzESlo8FYsNev8GsVC1d600LEaWp3VMtWz1ZqVZH1tl2ydnmiqDhsVBwvT5rBVbUyPQcS5DN+VbGXjGXq1lm3oreEZfa8rUBNAdddQ+NGL5Wqd+tgmLWHpCJ9p9O1l4kohpNc6YUNjsRQr0xOF... | code_stdio | abc349_a |
[
{
"content": "In the calendar of AtCoderLand, a year consists of M months: month 1, month 2, \\dots, month M. The i-th month consists of D_i days: day 1, day 2, \\dots, day D_i.\r\nFurthermore, the number of days in a year is odd, that is, D_1+D_2+\\dots+D_M is odd.\r\nFind what day of what month is the middle ... | eJzdVUtu1UAQZMGGW7S8jtB8eqanOQkSjwOwebBIVigShwhnYseZqGp7QnjzsskGKXH5xR57+lNd3f7x9ufvd2/i7+MvXHz6vn05f7u73T7IlsvpXLOUIfit6cnvP7en83Yj29e722ObCfZt9zfy1NTpvLyXJS/vdXiULIqziV/uaFJfbBkrvhiEl3TV4pU38/rmOJ2Libm4yxgyTHoRk6GXuxUPlt0VyXjn9pykuBTxJNbFixSSMIr0Jh1vgGgcPZEV5Qqeq0nuUrmNdwq+sFdr2OvS1gz0WgoVjOeUxIe4ildiNKQgI9OUGc1aBGFJ... | code_stdio | abc315_b |
[
{
"content": "There is a 9\\times 9 grid A, where each cell contains an integer between 1 and 9, inclusive.\nSpecifically, the cell at the i-th row from the top and j-th column from the left contains A_{i,j}.\nIf A satisfies all of the following conditions, print Yes. Otherwise, print No.\n\n- For each row of A... | eJzNVruOFDEQJCDjJ6yNT0h+23wEMYghJCCZQ+IuQkh8BPwrGbiq2ssyDOwEHOIu2Rm7H9VdXT2fHn/59uQR/158HT9efTi9Xd/d352euZN3wUWXXHbFVddcX9aLB8fjZb140N1l3Zg5v6wbM5eWdWPm6rJuzFxY1o2Zy8u6MXNtWU837nR7f2eJv3zzfrz6eOP+DGYnzZ0EdiDvgNlJc6cwO5Cvgnl+ewTLscb8e8MDWPJwAosybDrw9/Eij4cy3JnnMH7G8dD5OqNweTwUmnoeJnWvjVMYwUlBSnAbmVieDY00QZAwjju6JxMcAURG... | code_stdio | abc327_c |
[
{
"content": "There is a grid with H rows and W columns; initially, all cells are painted white. Let (i, j) denote the cell at the i-th row from the top and the j-th column from the left.\nThis grid is considered to be toroidal. That is, (i, 1) is to the right of (i, W) for each 1 \\leq i \\leq H, and (1, j) is... | eJztXMuO0zAUZcGHWLnbkdU0aR58AxI7hMTwAWwKi5nVaCQ+Av6XxK84ubYTOSkqcDyVm3FPjh37+vYeO+mPt78+vn+j0qcPw8Hnl+Lr9fvzU/FOFJWoxeXxWjyI4tvzkymUJOXjlVQu5ZgXrw/CO+sszqI8nU7sRHUCg5cnoV5L+FiDTro2eyzl8ceOnnjzxPDH2haGhS46gKw6UfVnxqkbINOJ012GmuuyDVQ8XpjKV1/LEWxF2YlLw6971kRS/TVkw/DQomx+LTSWkYejaQyIXNlwpPj8OqydkdczBsf75l8vIwrgZoW6/7yOdvPU... | code_stdio | abc339_b |
[
{
"content": "You are given a string S consisting of lowercase and uppercase English letters. The length of S is odd.\r\nIf the number of uppercase letters in S is greater than the number of lowercase letters, convert all lowercase letters in S to uppercase.\r\nOtherwise, convert all uppercase letters in S to l... | eJxllMuuqzYUhjuo+gKddXS0x0d9gM4IAcL9mnBpOwAMDtiAbTBgjir1Idr3LcneR+oOjNDyWt/3G2nx94///vLTD88n+Xl/+f3bW9MTPr399uVNmuQBVOyP/u3rl7eBTx/lfCo/yn99/fK/9pD3kRukr+3h1fkof27PD9xDi1ryORWjlunmZomRKY3qRq0Gp3UT7arW5iui3geEGOHWoA3vA1VTD1MLPwbqGh0UcXPf4JQaVTfIqmaWmqRUYX87R9ENyzapCjEAy45my5jb+6I5jmUlSAXhNLGAuxLoVDrdX2PE+iXTotRQbPcBlXeo... | code_stdio | abc357_b |
[
{
"content": "The pattern of AtCoder's wallpaper can be represented on the xy-plane as follows:\n\n- \nThe plane is divided by the following three types of lines:\n\n- \nx = n (where n is an integer)\n\n- \ny = n (where n is an even number)\n\n- \nx + y = n (where n is an even number)\n\n\n\n- \nEach region is ... | eJxtlj2OJjUQhglIuIU18Q6qf1dxEiTgACQLwW4EK3EIuC+PRyCtxt0TTKvbXS6/f/X99e0/f373zdv142dufvrj5dePv3/+9PLDepEly5f//PHlw3r57fOn/x6r8OTLh/XVylddr7b0Ya0+rJX/r/X1/ePt+3oh13VtkOO52yfpaaJk74i1ZdTFo9eO0p0mcfVqYhUpureo5OyHc9bu4uWe9TojGhoea2QmRiNXSm2v8QsH882XFZU6VAiTvovz1HepUXy70WKKLTPK7+iDcLhsb5331V13t20JpW/P8ifUARs+L0QfDtnNjjUFgDXd... | code_stdio | abc354_d |
[
{
"content": "Two characters x and y are called similar characters if and only if one of the following conditions is satisfied:\n\n- x and y are the same character.\n- One of x and y is 1 and the other is l.\n- One of x and y is 0 and the other is o.\n\nTwo strings S and T, each of length N, are called similar ... | eJy9Vkuu40YMzGJWOcWD14OgaPnZcg6RdYLxLPSxvpQoWdKTrSDAHGJy3xT1kkUyGECb2DYarRa7imST1f7y4c/4xx/Wz6+fOPn0+65su2nc/fyyCy6tYr60Yhx2H192No1/v/rtOnDpj48v/zaP4oTDLfmv+S/2jfXh0rZWgyNq2wIvl7akQxugaclFbAIFzeQJX8b5BJotyfGIYeMbUKiaiHG0MAWU0/kMUZjizMX7Vfd7qKZ9eOLiJOlsNGsEI+zKfcFiDeRBkxlVLirdFKp1117tShbD+GaEFRr4D2Fq4JPMZyMZxM705n6V/Z7P... | code_stdio | abc303_a |
[
{
"content": "You are given two strings S and T consisting of lowercase English letters.\nDetermine if there exists a pair of integers c and w such that 1 \\leq c \\leq w < |S| and the following condition is satisfied. Here, |S| denotes the length of the string S. Note that w must be less than |S|.\n\n- If S is... | eJy9VjuuKDUSnYBkdtG6MWIBs4iJQUBQtst/u/z/jUZiETO7I2MjGESAeE+oo+eo1V22T52qOqd/+ur/v/zzH7+vb3++D9//58PE1NvHv54PaJwElqcR/hA/vn4+qLc/Pn2H9b7679fPn8IZKhPjjS9/jf43fRI8sDTDwRcEYaJ6QOkXu5ZUzVsFc6Y1m2WruZp6Z6vqOraFzVhreUCKfM+srH5mb58c/DnweDjjvQuj4F5xDjG9DrhpQGLCkGOGJUKYq0VnWjD1kW+OjRJ52N7mFppVYVnelELYulrGQldWVF12JJn8MV0nL3AwG+Ko... | code_stdio | abc360_b |
[
{
"content": "The AtCoder amusement park has an attraction that can accommodate K people. Now, there are N groups lined up in the queue for this attraction.\nThe i-th group from the front (1\\leq i\\leq N) consists of A_i people. For all i (1\\leq i\\leq N), it holds that A_i \\leq K.\nTakahashi, as a staff mem... | eJzdlktuJkUQhFmw4hQpr0eoK+vNSZAwB2BjWMysEBKHGM7FjvPwRXR7GLvNY83M71J3dVZlZmREVv365W9/fPWF/337Ow/f/fzww9NPH94/fBMPM8bjU0aPEo2/jPr49PAuHn788P6yaEz88i5erCnH41NhjM+G1+vmbV3By8HKWWNF75Ej9oy2ojLOqF2T2BBTEsk4Xm+57lvK7811udsdx+l7jcD9PGKXqOS8Y+5oI8bWa25HVGIdsVYUvq6YI7IpzNFjEViJPjSyT8d/xuqxmwJnhbfkt53GZFarjFHR+2bjqW06NhlAwt55RGKN... | code_stdio | abc353_b |
[
{
"content": "AtCoder Inc. sells T-shirts with its logo.\nYou are given Takahashi's schedule for N days as a string S of length N consisting of 0, 1, and 2.\nSpecifically, for an integer i satisfying 1\\leq i\\leq N,\n\n- if the i-th character of S is 0, he has no plan scheduled for the i-th day;\n- if the i-th... | eJztWUtuFDEQZcFBWrNhE6GqSsiHkyARDsAmsEhWCIlDwNnYcRba9X22R1GS5cQ1mUzbfq7PK9tdPfPr7Z9/796ofPq7X3z+cfh69/3h/vBxO1xufHvHLCRye3c42w7fHu59qHX8PNsAfN7AMiPPJ6Q0JPEIpAnICnwibjLME+6GrjfecUx7RPoWJt5F9k9ibVFr7NIaezT78A60kf1DUdSkTTI1TQPZdNZ+U2EDqrzNV6VNg9hfw4haIEPsH80SmXkzToYnm8ltUptmbrB6qO6pM9w69M3a1Zxxv7kNqEZ1WhESzrYRThFSSsSiJE5a... | code_stdio | abc332_c |
[
{
"content": "AtCoder Kingdom uses a calendar whose year has N months.\nMonth i (1\\leq i\\leq N) has D _ i days, from day 1 of month i to day D _ i of month i.\nHow many days in a year of AtCoder have \"repdigits\" dates?\nHere, day j of month i (1\\leq i\\leq N,1\\leq j\\leq D _ i) is said to have a repdigit ... | eJztlk2OJUUMhFmw5BBWr0eoMp2/HIIdEhLNAdg0LGZWaKQ5BNyXLyJfSwM10swSIfon9SrL6bTDEfb78PWfP3zzlX9+/J4PP/3+9MvLb+/ePn0XT6U+v2SJuoM1r4/Wvz0+vzy9iadf3719PZbsvH8TH3u6nl/KFfiKjBY9RsxYUa7rdvh2NrGZiXXvUUfsGW1Fss7Irs0eZcao+B5X1Iy9A/tsMTu3tBGrxmpKoxFxVdydtd6u7ve4CfvzEcrqnkm92dX2/LKVeV+xVlRSmk4AFJcSE9KpJHtTkkKsRmvKs0XZNpkxbxGN21UdI1Ll... | code_stdio | abc328_b |
[
{
"content": "The coordinate plane is covered with 2\\times1 tiles. The tiles are laid out according to the following rules:\n\n- For an integer pair (i,j), the square A _ {i,j}=\\lbrace(x,y)\\mid i\\leq x\\leq i+1\\wedge j\\leq y\\leq j+1\\rbrace is contained in one tile.\n- When i+j is even, A _ {i,j} and A _... | eJytlktuZUUMhhkwZBGljFvI5Xf1SloiTJj1JDDoHiEkFgH75XNaSHDPlRJCR0l0c+JTLvt/2L9/++fH7755/vrwEx9++PXh49Mvnz89vF8PseTxSVc8Pj28Ww8/f/7093Me/PZu/SPS1n588vn170i5RGqEprRKhlacWOF7q2lnlmlufXyq2h0pErFbtFcRrFtKz+adtNsku46fqk51lR37ktOrN4c3cd599tpt3kper13BgZeIk+4a5Tu9zulLC46nFK+KC8WYXnJmOCHR1k55u1bIkU5qOklVRVIr28eij5laVy1VrnGCtHG44qVQ... | code_stdio | abc359_c |
[
{
"content": "You are given two grids, A and B, each with H rows and W columns.\nFor each pair of integers (i, j) satisfying 1 \\leq i \\leq H and 1 \\leq j \\leq W, let (i, j) denote the cell in the i-th row and j-th column. In grid A, cell (i, j) contains the integer A_{i, j}. In grid B, cell (i, j) contains ... | eJzNV81uZjUMZcED8AhW1wPyTxzHSOx4CCTKA7ApLGZWIyQeAt6X49vem0wb2k8zC+jiU5rEf8fHju+fX//94zdfHX8//YDFzx/vfn34/cP7u+/prpHfPwgpGR3LTkGDkoSxLSRKYiSNpK51kiAZJEla5xBScmqPV+247bhdagYUCVM+io2SVIbk/cPdO7r77cP7JwcMG3+8o8UlJS3d8uyHz7/nGr6VFyqMoBY2qd8/GDyM+4eGoPRfNj/Vxy/UeSETwi7CCmysW4ZrUHRjDYuk3lpwT+xh0UPVoCYjRxdlIBtjaEuA3DRNfCSlQ6FB... | code_stdio | abc332_d |
[
{
"content": "AtCoder Land sells tiles with English letters written on them. Takahashi is thinking of making a nameplate by arranging these tiles in a row.\n\nFind the number, modulo 998244353, of strings consisting of uppercase English letters with a length between 1 and K, inclusive, that satisfy the followin... | eJzFlsGOJDUQRDlw4yesOa+Qnc50OvkSJJoP4NJw2D0hJPbGB8D/8qKaw9Ie0A4XZlTdrmqXnRkRGelfv/zjt6++uP6+/cjgu59ffrj/9OH9yzftxW53a4P//pb/2/3lXXv58cP7v1YZevLLu/bJwjP27a5lP73+w9LLj6VH70zTZ/s/P54jteyW3mccAWev231nNde1gNvbsNnSvTmrFV+ezVg3rNWabaW3bdVqe6vZ2zRra0Vbvtrc0UaNNoN5nfHozRnPWAcvI8eqHXaEVDFudy9rrl0rWSlbGautbDmy+dwERGx7kS0BbnZj7u6r... | code_stdio | abc358_e |
[
{
"content": "AtCoder Inc. sells merchandise through its online shop.\nTakahashi has decided to purchase N types of products from there.\nFor each integer i from 1 to N, the i-th type of product has a price of P_i yen each, and he will buy Q_i of this.\nAdditionally, he must pay a shipping fee.\nThe shipping fe... | eJztVkuOZEUMZMEFuEGq1yOU6V/anASJ5gBsGiRmNqCROATclwhndVdPV80Klt3SvHG9l3b6Ew77r2//+eO7b/rvx98h/PTnwy9Pv336+PDDeJAhc87hcz4+LUqr/x/x+PTwYTz8+unj88HFIw+fP4xX2vp1bb/8/NJKxB0rX/HhjjrP3aivsVrj9vi6c7aWxnAzeXwSt32rtCvrjl6q6cA/nG/xRo9v7+htkzWkBN8g3olpzXuKOva0sdWRyl3D4C1s4e459Obm6bce+1g7FUnNfHxSo9bGO6RPhD/UaS6kX73xCIo39vZQdzxiQs2V... | code_stdio | abc332_a |
[
{
"content": "There is a 3 \\times 3 grid. Let (i, j) denote the cell at the i-th row from the top and j-th column from the left (1 \\leq i, j \\leq 3). Cell (i, j) contains an integer A_{i,j}. It is guaranteed that \\sum_{i=1}^3 \\sum_{j=1}^3 A_{i,j} is odd. Additionally, all cells are initially painted white.... | eJyVlr1uXUUQx5GggpdYuc5FO7PzScc7UCARinSJkBwkkgoh8RDwvvzmmALkRLq+Lnzse3Z35v81++dXf3/9zRfX58cvefjp94d3j79+/PDw3XrYi5/Xj3vJ06/rr4dX6+H9xw//vvLDm1/evH3z29t3fPHHq/WfxTd5WnazddN186cnuZ7+v8f373/5xHIVsW1n+9Lo471LVp7IdvPZNuSElEmsVDtRR3zdWk1UzY0XWkui+GLdTCtd/PS6HQvrLf6sk09WoRqHpcVCkVOVlNPncN457ODqlk1F65blLep706Cc9tQTrx/P7tIwBYCq... | code_stdio | abc349_e |
[
{
"content": "There are N buildings aligned in a row. The i-th building from the left has a height of H_i.\nDetermine if there is a building taller than the first one from the left. If such a building exists, find the position of the leftmost such building from the left.\n\nInput\n\nThe input is given from Stan... | eJztV0uOZEUMZMGWO4RqPaDndDo/nASJ5gBsGhYzK4TEIeBu7LgKEZHVEkw10BLbabWeXtXL5084HHb98vlvf3zxmf+++Z033/50+/75xw/vb1/j1p+eEw2F9vR8e4fbDx/e358kv/j5Hf5ylt905OPJL+Ph6Hx6jotWeWm6RCLq4/fGw2txXXrxwt7YC3tiD+zC7tiJ3bAD+8LaWAtrYg2swupYidWwAuvC3JgLc2IOzMLsmInZMAPzwtgYC2NiDIzC6BiJ0TACgxFv1EJN1EAVqqMSRXwCdaFv9IU+0Qd6oXf0RG/ogX4hN3IhJ3Ig... | code_stdio | abc353_a |
[
{
"content": "There are N people numbered 1 through N.\nEach person has a integer score called programming ability; person i's programming ability is P_i points.\nHow many more points does person 1 need, so that person 1 becomes the strongest?\nIn other words, what is the minimum non-negative integer x such tha... | eJztl01uJUUQhFmw5gwpr0eo6zerOAkSwwFYMLDwrBASh4D7El9UI8Q8W+MdEmLm+blVXZU/kZGR5d++/OP5qy/879sf9fDdL08/fPj54/PTN/HU338YUUbUKNf7D0/v4umnj8/3u1K08uu7+Od2bX55+/Wwu2n3dcX982D+Yb9W5hvM2laJ/8T/z4OytZSXEO89eo15Cf65BGjUEn1H1fIVrUeLMVjW5lJjZMwRvUTqRelRdWTFnNEH78a6Pyv6jFZsbJoJPeaOIZObdXkYPE4FW6JNnPXjzsYJpR8GKTpcdI7JQ5NtBVJktXE8/Vij... | code_stdio | abc313_a |
[
{
"content": "Takahashi has recorded the number of steps he walked for N weeks. He walked A_i steps on the i-th day.\nFind the total number of steps Takahashi walked each week.\r\nMore precisely, find the sum of the steps for the first week (the 1-st through 7-th day), the sum of the steps for the second week (... | eJztlk2OZTUMhRkwZQ+hRgxaKLaT2GYlSDQLYFIw6B4hJBYB++U7KZCgXkkMmCBEt3Tfq/tuYvv85f786a9ffPbJ/ff153z55sen755/+Pjh6avx5O+fbc45XJfQZemydTm65N//WlzePz+9G0/ff/zwx751l+yXn356N/5UM6i5bPfws2OP6uwYHrUOd1bEqPBsqnjVWNZp43R0j8htVC+fPXL1WmO3B12UnTWOFxvM4sHiO9VX+ebqZjR62LLcVr1uNYyaoULLc0Ts8Hro2d4/7+XL2S7a6VZL2tXbTvZfmYdanucRijbL9RYK0ek2... | code_stdio | abc307_a |
[
{
"content": "We have N dice.\r\nFor each i = 1, 2, \\ldots, N, when the i-th die is thrown, it shows a random integer between 1 and A_i, inclusive, with equal probability.\nFind the probability, modulo 998244353, that the following condition is satisfied when the N dice are thrown simultaneously.\n\nThere is a... | eJztl02OHEUQhVmw5gypXlsoIjIyfjgJEsMB2Aws7BWyxCHgLOw4G1/UGAnTbWm2SDNjd3V1Z8bPi/de1vz29R9/ffPV9fP9n7z54dfbT8+/fHh/+27d/OlZVy5b/fR8e7duP394/+mbdsuKvVlx+/hu/WtPzh4V/l3/X14+vf5zkbtwHapZmXfh9On5Lrk8WqWvW3WX2ro995Z4vPxhuaFRXeL3KS7EbO3l93lUj4fsuz19Ifb57yuakQfb7jfqg42Pd/4ff1/ZrbuWxbIW23t1b41YqlVtq7RkZXCzWWB+mN+OOr2Op/te2Xq2LL6a... | code_stdio | abc310_f |
[
{
"content": "You are given an integer sequence A=(A_1,\\ldots,A_N) of length N. Here, A_1, A_2, \\ldots, A_N are all distinct.\nWhich element in A is the second largest?\n\nInput\n\nThe input is given from Standard Input in the following format:\nN \r\nA_1 A_2 \\ldots A_{N}\n\nOutput\n\nPrint the integer X suc... | eJztljuOHkUUhQlI2cPVxAh11a0nK0FiWADJQGBHyBKLgF2RsSG+c6qNwP+MgBxHlt1/d93vPG79/Pmvv3/xmf988xt/+fanp+9ffnz/7unreGrPLytq9CjPL09fxtMP79/d/5P8w4cv4y/PrueXwrMZTc9fsaM8/Go8/Ir3JL96eLI+PFmu6/nl4/tHzFj6xMVXovCCjNKi8OURZUZZUXbUKypnqlH5Rovao46oMypD7cgrskTyyoxskT1yRM7IFbmjXdFKtBqNL7ZoPdqINqOtaDv6Fb1EB01G50A9+og+o6/oO8YVo8SoMTJGi8F5... | code_stdio | abc365_b |
[
{
"content": "Vanya and Vova are playing a game. Players are given an integer $n$. On their turn, the player can add $1$ to the current integer or subtract $1$. The players take turns; Vanya starts. If after Vanya's move the integer is divisible by $3$, then he wins. If $10$ moves have passed and Vanya has not ... | eJzt2U2OG1UUBlAGSMxYQ6vHEXLdquu6lwWwASZINCNgkIlBkIxQJBYB+8XndiOhxB1CUERQHCWO8+Sv/VPvO37v5dePf//05qP59dUn5ztf/3L79PTj82e3n9/cHu9Oy91pvTvl+c7hcHfq7rl3vnv75Ob2h+fPHh75xdOffn52d/ry+29/OH13d3r45+XR2xdPbv7yJOdniEd+3KuP7N7e+LHLKz/2zxfy8mMP8z5j3uo27/b8zve7U52f0Pt95Cn/yZu+NPryy1jnBfzt7+Wxt/Wu/r78CefhYVIsBx/2Idx4eYfNzUwZE+iwuyk3... | code_stdio | 1899_A |
[
{
"content": "You are given a string S of length N consisting of lowercase English letters and the characters ( and ).\r\nPrint the string S after performing the following operation as many times as possible.\n\n- Choose and delete a contiguous substring of S that starts with (, ends with ), and does not contai... | eJzt0T2u00AUgFEKVsAKRrfBI1koROKBvAwqJIYiyXtFmokLu4oisQgWTBx+xIuDBFUS6Zxy/Gnmjufry0+vP7568Xkf29qPQ3QpPpS6atbNY86bUqNNsRuHn59W08qhTX/U7051bmZpM0uXpTb5vJtVD6XmnJtmtuPv1ef92+Ou5+nFanZ0vlStZheZVe+PJzab/JifztunS+30Mzd5dvp834epbXJez9L1pfbyCD+WnsfHFz3N8E8TP/yaeP6i8zGWi8npxQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... | code_stdio | abc307_d |
[
{
"content": "You have an empty sequence A. There are Q queries given, and you need to process them in the order they are given.\nThe queries are of the following two types:\n\n- 1 x: Append x to the end of A.\n- 2 k: Find the k-th value from the end of A. It is guaranteed that the length of A is at least k whe... | eJztWU2OHUUMZsFBRm8dofJPuWxOgkQ4AJvAIlmhSBwCbsSOS/FVuea1p/OSCQHx+0aalqe7ynbZn12258fPf/718tn6+eoXEF//cPn21fdvXl++fLj0l6/ogdt8Cp78QJPURcrLV5cXD5fv3rzei9cK/F7evngoPNYWOi8+LRpzUbcWbkayJb338ZRV2faJ5FljWSpHGJuP2yrQQzQVZ4qlLT9dwM+ofPD+WKpIK+Rz3wt5PqOuM2B/eLQPGftjH09PWDj/E8jT6VkT2NbFPf6Ew/9RcxVV/sPU2QuRcda1NervDbTB6oPH8GtkvRte... | code_stdio | abc340_b |
[
{
"content": "As the factory manager of Keyence, you want to monitor several sections on a conveyor belt. There are a total of N sections you want to monitor, and the length of the i-th section is D_i meters.\nThere are two types of sensors to choose from, and below is some information about each sensor.\n\n- T... | eJyFl0uunTUQhJFgxIA1WHcckN1t94OVIBEWwCQwgBFCYhGwX75yeIR7TsRVkvuf/9jt7uqqaue3z/74/ItP7s83n/Lw7S8v37/78eefXr4eL/72nY8z1nz7bg8ffLRhI96+e3kzXn74+ae/lq3kza9vxv/u9Nc7v1wPO007StsX2+9+fs35/sN/t5+H3cTTH+3959erZJ/ucSutT19tZ8XIbH3eUZYdmYOH15F87TVZbeGPACjobL9JnLmIcmKYFq7R80TMjhjV+3XUWrMs1jLOfhp11yTKBt7yMj7VSFO2Z/TKlbusOLNfB7ZJvn1O... | code_stdio | abc325_f |
[
{
"content": "You are given an integer sequence A of length N and integers K and X.\r\nPrint the integer sequence B obtained by inserting the integer X immediately after the K-th element of the sequence A.\n\nInput\n\nThe input is given from Standard Input in the following format:\nN K X\r\nA_1 A_2 \\dots A_N\n... | eJztmc1uXEUQhVnwGCxas47Q7f/uPEkkhgdgM7BIVigSDxFelR0S3zl9jey5ExmsiBjZyXgynttdXXWq6lR15bdvf//zu2/8590ffPjh19NPl18+vD+9DacScujnS+KfGmI8X05vwunnD+/3x+v7vp58fBPu7YyBv9t2vvjt4Ta+Ws+u9owwQj5fZph8SKEEHV+vd1891o7rsyU/tIKoGibrNpbWFFILaYSmnSU0fokhVWR1bMshIyqFxnfI7aFWrRopdH7N2ps5F7Estvr6BclthDolHYEWErVJcnOIzZ9DmZIyLbSlEEuINSQkjDBb... | code_stdio | abc361_a |
[
{
"content": "Takahashi and Aoki are playing a game using N cards. The front side of the i-th card has A_i written on it, and the back side has B_i written on it. Initially, the N cards are laid out on the table. With Takahashi going first, the two players take turns performing the following operation:\n\n- Cho... | eJy1mM+OJzkNxznwDlyjPq+Q7Thxwo134IDEcJjbrlaaRdrdE0JC4sYZ3pePf9NdlWxX09VIjEbdaSeO/+Zru/7+63//8ze/evz74z9Y/OmvT999+cvPPz39rjy1T1+0zE9frLDyXGnx5z+fvilPP/z80/PJ3//w/XfQ/vZNWdg5X4slUyS75mp8+tKSNnNlSesHbb/yD5+///zt5x+/fX2vwqAqIbVqLT1ch1jbiKbuXXz4SqxDZ9OoshHdqnbf7xyDW0PH3E5quMUYbSXGlB6j2yZIERwmXVfi7Mb/4fudvZrWZraxN4fyC4umj6G9... | code_stdio | abc354_e |
[
{
"content": "You are given a string S consisting of lowercase English letters. Find the character that appears most frequently in S. If multiple such characters exist, report the one that comes earliest in alphabetical order.\n\nInput\n\nThe input is given from Standard Input in the following format:\nS\n\nOut... | eJztVkmOLLcR9cKH8PKj14IP4JMYkL0gg/M8T4YAH8I+pnY6gFhk9pfRvfBearJQxSSDMbyIeJX//vN/f/nLn874+8978eO/3qQLtbz97dsbSzRW6mD+w7398O3N1/Ic0L3x0w/f/kcUFfCEpo+C6JNgyLQSf7/FDD6ghIqYyUsis/1433+6vz6KrE8irH+UYZ9k/FJphBUKQionmQzwghzRvC5QFvnUFmW2yqkCE82nYXybyMoquPCR0IqxxHbSrjWNJLK97bJRtkmXqzRVU+Lrmng6U2RHFplAYBjRGeLeoCiqya5JHCEXTqr3RXDk... | code_stdio | abc338_b |
[
{
"content": "You are given a weighted simple connected undirected graph with N vertices and M edges, where vertices are numbered 1 to N, and edges are numbered 1 to M. Additionally, a positive integer K is given.\nEdge i\\ (1\\leq i\\leq M) connects vertices u_i and v_i and has a weight of w_i.\nFor a spanning... | eJxtl8uOHUUMhlmw5xVas45QuWxXuXgSJMIDsBlYJCuExJ4dgvfl+7sqQNITJTkzfbpdvvwX9+9f//3nN1/df77/gx9++PXlp9dfPn54+e56yWtc3uv9q139Wkufflnr7187P9TQZ1wr9JnXyvevzu9l719f3l0vP3/8cOK4c+W3d9f/Qg89sKpHePo+wH36sBz3eeOKbB7uLfZpw2JObt9nzUgvvube0K+dR1tFe5zcM3yOqkcCdfW6lo++ooVVNltz5xHTuTh7W23MarvqGd68VWvm687CqHQ2AjhPhpK7L+ZFXiMopMdqbn0Xkznp... | code_stdio | abc328_e |
[
{
"content": "Team Takahashi and Team Aoki played N matches.\r\nIn the i-th match (1\\leq i\\leq N), Team Takahashi scored X _ i points, and Team Aoki scored Y _ i points.\nThe team with the higher total score from the N matches wins.\nPrint the winner.\r\nIf the two teams have the same total score, it is a dra... | eJztWLuOHUUQJeAbiFsbW6if1dVkSHwCARJLsJktS2sEtggQEh8BH0nGJ3Aec22EHSwRAd7gzty53dX1OOdUzf766e9/fvaJ/r75Azff/nz34vH7N6/vvih38/6x1dL12W73gx93z8rdqzevr3VfP7x8eP7w4/MX+OGXZ+VvFuL+cRWYmWXdP3betYJnm+Y+YOirHx5+es8GNtVS7QQuq5ZV+ajV+s/9X756+b4PTYuftLRfS1t5z/QHXdtcu8reiKaXOPePiahwGYcW+tGzOCUR9Dxl44DVS0My1iwzcVEqopbAZc6SiDZ3SVpcCnSU... | code_stdio | abc337_a |
[
{
"content": "You are given N integers A_1, A_2, \\dots, A_N.\r\nAlso, define B_i = A_i \\times A_{i+1}\\ (1 \\leq i \\leq N-1).\nPrint B_1, B_2, \\dots, B_{N-1} in this order, separated by spaces.\n\nInput\n\nThe input is given from Standard Input in the following format:\nN\r\nA_1 A_2 \\dots A_N\n\nOutput\n\n... | eJztlzuOJccRRWVwB9pAom1CyIz8cyUENFoAnaYM0hIEaBGUIU9L1TlRPYAwb+TJoDGD1zXvVWVGxufeG1H/+O6f//7jH/Lfj//iy5//9vbT+19//eXth/LWP733Msr69P72fXn7+ddfPu63KDG4+ffvy3+tnp/eI8qeJVYZs+x42bZmLe16abuWHqO+GNncijI5lDNm6di5ZY0Su4zLlnJnabWWqGWe0m+5UXota5dzvXNaPl6r7F7i6g63OG2y75Q4ZWv0njJzY2tl3TLYODy19dK4smmVPsoJ7RMPy7suzV1wv7OplcMq7pdTdfBW... | code_stdio | abc346_a |
[
{
"content": "There are N people, and the current hair length of the i-th person (1 \\leq i \\leq N) is L_i.\nEach person's hair grows by 1 per day.\nPrint the number of days after which the number of people whose hair length is at least T becomes P or more for the first time.\nIf there are already P or more pe... | eJztmEuObcURRWkwBtqhaiPr5Mm/m+55BpYoBkCnoAEtC4lB2PP13iuyngynEK+JLFOvuHXPzU9kZOxP3F++/Pffv/qC//7xN/3xzT9fvnv74acfX/4aLz3KFfX1rUYpUWLE/fr28nW8fP/Tj2fE1IOfv47/mnNH9zBNLNdvR1+P0dU7FA2P2xv98eLlunJ5pv16/N6PCR63FJCmLE1cMVb0EV3HGtH0L+ZmzaWP7hgjSovdY9+xVyxNjHZF69F31CtGj9oc8qjR7lh3TCWlx6pRezStxnalxnbC6oypP2c4KVWD9Vpizlgjxo59xYyh... | code_stdio | abc363_b |
[
{
"content": "N people labeled 1,2,\\dots,N took an exam, and person i scored A_i points.\r\nOnly those who scored at least L points pass this exam.\r\nDetermine how many people out of the N have passed the exam.\n\nInput\n\nThe input is given from Standard Input in the following format:\nN L\r\nA_1 A_2 \\dots ... | eJx1mEuuZEkRRBmwAXYQqnELhcc/eiUtUSyAScGge4SQWESzSmasgHP8JhJUJiW9ynz3E+HuZm5u8f7+23/863e/yX8//ZMvf/jrlz99+8svP3/5sXyZZdWv31YtrZaotdxaBhe+/FC+/PmXn18PdS787YfyX6+Ncnhq37JP2bvs9f0r9e2VqGVytUcZUeYtbZXZyzzl7nJ7ab2c8f0q632VEl+/vQX4YTez4fLz//8+HR9iq9ThfP12Ri1nkd0hurglRivjlDiTMEdZp1mhs/hoPLBL22ayy6KEve8yJ8mdW+4p/NZmmazQGhdXGSvK... | code_stdio | abc330_a |
[
{
"content": "There are N rectangular sheets spread out on a coordinate plane.\nEach side of the rectangular region covered by each sheet is parallel to the x- or y-axis.\r\nSpecifically, the i-th sheet covers exactly the region satisfying A_i \\leq x\\leq B_i and C_i \\leq y\\leq D_i.\nLet S be the area of the... | eJztmE+uZjkNxRmwDAZRjVvo3vy5SXrOjAUgUSyAScGge4SQWATst8/52fmq69UrCYkhVSVZX+x3E8c+Ponzr9/+54+/+w3//vQH/fjzPz789dPff/7pw4/lQ/v46Sqj3EU/7tKLBh8/VWlq6R8/ffihfPjbzz/l39ZLmn/+UH71efXn93UV5JvBl19LdX09Aevf/sI/Wqwvf2KSt3M84z0P9j6rviZ7b/n7G977/2ffY7Kvvt7rva/HXcYqs5Upx1Yr6ylVUdxvP//G19qsJrD8nyOXPzIU72+ivjdHH2WMsvWNB6U+ZdSy9G2vZcq1... | code_stdio | abc318_b |
[
{
"content": "We have a sequence of length N consisting of positive integers: A=(A_1,\\ldots,A_N). Any two adjacent terms have different values.\nLet us insert some numbers into this sequence by the following procedure.\n\n- If every pair of adjacent terms in A has an absolute difference of 1, terminate the pro... | eJztnV1y6zYShTNVWQjKzzdTAkASRFaSqngWMC+ePNw8pVKVRcxOZwNzTlPOlS3ZV7Z+2ADPiyzzB2ic/tAgqQb414+//O+nf/zw6x8P/3767fevDz+Hh+HxKYUxxJAenx6+hIf//P51vyeFHAbsGvA37Q/480s4OHd6fFoOmXjY6/Nf7np5ZmKt8bjGeHRk3O0en+YxzEPYf+bn71N4vT293FsOjjncu3yPYd6FUr99csthCYflzGGu+8+6e/G9xv2W/ff0bQuPKe8emUMd7DOd+nxVzvSitFflP29/ramk+4h0L9kbKjDdAWE0b5zD... | code_stdio | abc301_b |
[
{
"content": "There are 2N people standing in a row, and the person at the i-th position from the left is wearing clothes of color A_i. Here, the clothes have N colors from 1 to N, and exactly two people are wearing clothes of each color.\nFind how many of the integers i=1,2,\\ldots,N satisfy the following cond... | eJyNmM2OZTUShFnwDKytWrfQ8b/NkyDBPACbnlk0q9FIPAQs2fGgRHxpFz1djKZap13n3nt+7IzIyEj/8vVvf3zzFf++/10nP/z75aeP//r508t36aX++DGnknKqGvXh5UN6+efPn86vRV/850P67Pri631H+fLa58217cePLZ7LG1rKX95T39yTHz2nldRbGi2VmbpuHWnsNDTHnfaTWk11pt3SLmnrgpXmTOtJq6TRU65Jt7fs6/tIa/invn198wO6HrN8le7rM42axki1pbk1Rd2/ul+QZ8olTS30SXWk/KSpRegnnehyXfn4yDmt... | code_stdio | abc359_b |
[
{
"content": "Takahashi wants a beverage called AtCoder Drink in a restaurant.\r\nIt can be ordered at a regular price of P yen.\nHe also has a discount coupon that allows him to order it at a lower price of Q yen.\r\nHowever, he must additionally order one of the restaurant's N dishes to use that coupon.\r\nFo... | eJztmU2uJUcRhRmwCkapHlsoMyPyj42AhGHOxDCwR8gSi4D98n3xzKRfswAkWurq63urKiMjzjlxIv2PX//rz7/5Vf35w+/58Me/f/nLD3/76ccvv2tfoo3e2+rf/7B7m70ln75817789acff7nj+M3P37X/8hB/eM5rev366dE/Pz4aL/j+h/H1vfPTnRntjRWskPfx8+hnjHYiz2nrzMnP585su49xW8bw8+q1j8l13n1vG3li+Ypx2r7jzXYmX2y+f23uHlwzb29jvswWZ77b7uFPi7nYWfS6vfdsmbFum+Ny+5t7ZTv7nTZe7FFf... | code_stdio | abc310_a |
[
{
"content": "There are N people numbered 1 to N.\r\nYou are given their schedule for the following D days. The schedule for person i is represented by a string S_i of length D. If the j-th character of S_i is o, person i is free on the j-th day; if it is x, they are occupied that day.\nFrom these D days, consi... | eJztXEGOI0UQ5MBDrDmv0Hh2hwVO3PgCEsMDuExx2JVSQivxCPgC72TsrsqMiCzP2tWwp2zN2u3uqorMyMis6nZ7//z675/++eq8/fzjy84vf9z99vz7xw93Pxzu3h4en56ttWZPz6fX/taenu/eHO7axw+93cPLgU9vDtTz7UvbU8t44T7HC33OWKfmL7ja5z71OR7en206bdr6fWr9eDg+nkfHbTsQx0xbnA9YP2Taoh9g6McE/XA4Hoeldto6o+ctmf521v9hi8WA7pGxYeMVFpyiab3PtuPkBRtXWPJ9t6Sj2xhr49HizDXjvTs8... | code_stdio | abc311_b |
[
{
"content": "You are given a sequence A=(A_1,A_2,\\dots,A_N) of length N and a sequence B=(B_1,B_2,\\dots,B_M) of length M. Here, all elements of A and B are pairwise distinct. Determine whether the sequence C=(C_1,C_2,\\dots,C_{N+M}) formed by sorting all elements of A and B in ascending order contains two co... | eJyNWUuObUcRZMA+KPXYQvXJ+rEIxiAeQwZM2kjYIwuJRcD2mLEP4pOnjelncS13v9vnnk9VZkRkZJ6///Kf//7VL/Tf7/6FD3/44e3P73/5/ru335S3UfqXd/wq88t7lPbl/e2b8vbt99/l17//019x6G/flM+XNF/S//eS33776YrGG+P/l86tpeO8NnBRw88qLW4JfJolsMIVJXBs4OEHSzg4fsu9pfWNnxL8NMucZU18wmV7l7HLxl+tdNygYel7lb7KwcW9lztf2fXdeArWVatv0XFxxe061tvKLQcPbjiGVWDNHX9xmRtnD56J... | code_stdio | abc355_b |
[
{
"content": "You are given a string S of length N consisting of characters A, B, and ?.\nYou are also given a positive integer K.\r\nA string T consisting of A and B is considered a good string if it satisfies the following condition:\n\n- No contiguous substring of length K in T is a palindrome.\n\nLet q be t... | eJztXUuOJMcN9cIHacxaMLr6W6UNQZ7CgMcH8GbkhbQyDHjpnTfyfd0V5Ht8EVk16jZsT7uV1Mx0ZiSD//iRma2//faf//jhNwN+//eXiz/85dOfvvz5px8/fX/z6fnm4fMXD3ML//zl03c3n3746cd6dnhp+Ot3N4L9cHvz/PmLvRI29A5Pd6fHh/unDd3D483jWYyX/653v70kzvFFnBfZ7eXPixKO6zOZl5Zz48uFn/9u1Lt7PN09bIkebm9vbw63r1dzhx12+P+FdV64vz+dTsenw/Hy1HD6/CUE/Pw3IX9W2/mfcdNouPTloTwb... | code_stdio | abc359_d |
[
{
"content": "You have N keys numbered 1, 2, \\dots, N.\r\nSome of these are real keys, while the others are dummies.\nThere is a door, Door X, into which you can insert any number of keys. Door X will open if and only if at least K real keys are inserted.\nYou have conducted M tests on these keys. The i-th tes... | eJztHcuu7TqNAR9S7fEVWknffAIzZkhsZkyY7DK4V6qEkPgI+F+aOHZsx2mTzYEBWndwd1frOo7fj6x1/vHrf/3+z7+K//3hd9fFH//28Zevv/7y88dvh49x8IP//BoHd12Mw/H55ePF+fn18dPwcfzycwK8gD7+/tPAXp2GeRjFq2O8mOAyXDi4nCLIdTkl2KnE/yrwO3fB7Z9f7kVvzcMyrMM27MN188J3gZiPXFwYLq7/79f99Xo+X3CBxhOfXcDx1hpf9wG2IGwrCNsuyPXza6G1lwv/GTYKJJS8m5dydxfzrncDGkAChM+RuAtN... | code_stdio | abc356_c |
[
{
"content": "AtCoder Inc. is planning to develop a product. The product has K parameters, whose values are currently all zero. The company aims to raise all parameter values to at least P.\nThere are N development plans. Executing the i-th development plan (1 \\le i \\le N) increases the value of the j-th para... | eJyNmkuy5kiRhRmwkN9ywgTaPB4ej15Jm1EsgEnCgBoBZiwC9tufPySF8vKqKoybulLIw/34OcdD+bdf/uMvv/qF//N/P/PDb//87fff//jzn7797+db/7SP/vRd+T/51J++t0/51E+zH+qnf+Sn74VflE//6fu3X3++/eHnP+WDmwt//fXnWGrGUks//ghLTH4qtkZbrCb2U1d7j71p3L8t1a7YT7v7T+XHl/2mfHlb+agHPlavWpo/xtLNYv8vHo49ttpb7639s8fuX3552t7EBnTq2rPrtHh7kbq44hv6j+/frKD2/jZ2kd5thVFq... | code_stdio | abc322_e |
[
{
"content": "You are given a non-empty string S consisting of (, ), and ?.\r\nThere are 2^x ways to obtain a new string by replacing each ? in S with ( and ), where x is the number of occurrences of ? in S. Among them, find the number, modulo 998244353, of ways that yield a parenthesis string.\nA string is sa... | eJztXEuOJUkRZMFBRr1yk0aou6p7upuNX4IFEnAANgOLYYWQOATcl6p0M3P3yFczs0XqB9R7mRnh/3C38Izm37/97+c//Ob6/PH9y48//fPdX3/8+z9+evf7795FZkb++cd333/37m//+Il3n15u/Ov778Y4vH7OYe9vw3J94viB8eTl1o3eD++f3z8/PX1+vtP9NazPMR/uY24sH4x5ke31c8nIXy/C6lb0Ld/nvbp+vYOsMT045kBOHwMyB9skWdRMjg9PeDWkropMcnS+/KVQTVwjY3zKAZT38owGgJRz0LkEeX0Aymd6LxNR3wHM... | code_stdio | abc312_d |
[
{
"content": "N people numbered 1,2,\\ldots,N were in M photos. In each of the photos, they stood in a single line. In the i-th photo, the j-th person from the left is person a_{i,j}. \nTwo people who did not stand next to each other in any of the photos may be in a bad mood.\nHow many pairs of people may be... | eJztnD2SJcmNhCnsQZ61TKMlIpB/exKaba+4wipNCqREoxkPQd6R2l6BAf8cr2u6xmxHIRXmCN3VryojEQjA4XBEzV/+42//9z+/0n+//fv64r/+9OV/v/3+j3/48p+vL/kaX7/Fa7zmK79+y/VX1Cdffv368rs//sE/VB/8+devD4/N1/RjX7/5Ef/rp09un56M7RVbvWl9ca5HrvXKe61wvPZa6lgf1T8vvp/16V3Gvfb1z3p4fWu8jq/fTtl6re/c63v1XK27198vr35r9aM+vfSKWmms7576Wb2jl67XHq/Qdrb1r3M9smupu1ZY... | code_stdio | abc303_b |
[
{
"content": "You are given a weighted undirected complete graph with N vertices numbered from 1 to N. The edge connecting vertices i and j (i< j) has a weight of D_{i,j}.\nWhen choosing some number of edges under the following condition, find the maximum possible total weight of the chosen edges.\n\n- The endp... | eJzNmkmOJlcVRj1ArCNUYwu9vmElSBQLYFIwsEcIiUXAeuGc+1dlhDPCNiBjXGBlZDTv3ea7321e/u1X//h1+Sr+/e6f+auvfv+XD3/89Odvv/nw2+ND+/gpH/3gxzzWx0/j46cPXx8f/vTtN5+f58qdv359XD6pflI+fqrv372/mlmvH4MNypGPeWz+K/zm741rHi9++GDxwubVnLhcrwt3SrzsMy6QkK9WrOcNZW5cNRXwXjpyPEK4wmLuNtip8E11z4+fdizr10qUYu8eu7Ahr20eKlqJeyHL/vLmVhdlmyESr7RYfLi8O05XDqk7... | code_stdio | abc318_d |
[
{
"content": "You are given a sequence A = (A_1, A_2, \\dots, A_N) of length N. For each k = 1, 2, \\dots, N, find the number, modulo 998244353, of (not necessarily contiguous) subsequences of A of length k that are arithmetic sequences. Two subsequences are distinguished if they are taken from different positi... | eJztm0uOHctxhj3wQhIcC0a+I9Nr8MwTA75egCe0B9LIMKBF2Pv190U1+xAkW4AmJiFcUbdZPKeqMjMef/zx6D///f/+c/xd/u9f/omLf/2vT//++T//9MdP/1g+rd8+t9LL8L/fPn/6Q/n0H3/645fvSqt8U0vlm//+Q/nqsfnlsfntQ7NsvmjfPcEnrdZv7/7+vsM90e4pvdd7S4vFNsZcpc9Ze+m18e/b2vbn4YbaZxm1bhad9bKn1kYtPcYYpa3Y0yevP/soq5/JI7dHaXvdxZP31tJaH5znnOB692i8fPFk6523933aYSe1s+i8... | code_stdio | abc362_e |
[
{
"content": "There are N people standing in a line. The person standing at the i-th position from the front is person P_i.\nProcess Q queries. The i-th query is as follows:\n\n- You are given integers A_i and B_i. Between person A_i and person B_i, print the person number of the person standing further to the ... | eJxtWkuuJTkRZcBCUjVuofTfZsCMPSBRLIBJw6B7hJBYBOyXOB87s+5r1NS796Y/YTvixInj/M/v//fn8Tv+7y9/ig9//de3v//8z19/+fbH61v5/nO+0hV/+Cn+SVfGP/Hp20/Xt3/8+otbxq94ED//+6frNcKIrte4MEq/2lWjzdehytXZDA+qP/FB1afuB0ndvkxeOHnZ/53Pgxadrx+m5W2C//445teldLaLRZSrwqR03/ilHeMaDG5nYZgXDzIb62l/f2362s5+tPcSi7ai+2vWP/39IKvdM1Q/FtTT4zFot+PXZ956lvAY9BxL... | code_stdio | abc342_b |
[
{
"content": "There is an N \\times N grid, where each cell is either empty or contains an obstacle. Let (i, j) denote the cell at the i-th row from the top and the j-th column from the left.\nThere are also two players on distinct empty cells of the grid. The information about each cell is given as N strings S... | eJztnU2SJMdxhbXQQWDwLRXGITEgpVPUUmaCDqANpAW5ktFMh5BWvBd3uotmKsPf+15EZnV1YyBwpM4Buqsyw/+eP/eI/Knq//jb//rvP//NffvHv3x68U///u2//Phvf/zDt//wzbcff/hxfNrqhx/r08/x6d3t09vPO2/Hr/uxb3/1zbf/+sc/TJnfftrxp199Ay2/+eHH22cVt3Xo333Yxn749aH22J5/feP+2+tk+3U699mTxbmP31EAWz3cV2noYjvTcSJXF68fyV2Pe9nett3eKPcKey/7+2XtPS93Gnxs6ftT9k7C/evGU/pq... | code_stdio | abc339_d |
[
{
"content": "You are given N integers A_1,A_2,\\dots,A_N, one per line, over N lines. However, N is not given in the input.\r\nFurthermore, the following is guaranteed:\n\n- A_i \\neq 0 ( 1 \\le i \\le N-1 )\n- A_N = 0\n\nPrint A_N, A_{N-1},\\dots,A_1 in this order.\n\nInput\n\nThe input is given from Standard... | eJztnE2uZUlShBmwkFaNWyj+TvywB+ZIJAtgkjDoHiEkFtEshRmL4zM7r15YJlkSzAopu1Bz6t17zvFwNzd384jb//7X//Fff/dX/s/f/ycX//Cvv/zT13/5859++ds//NK/fG1fvtYvX8uXr7/88Q+//POf//TxSfGf+ZCv/PJvf/xD3PSj7373ldq4bTzzy9e1z5evZ68vX+czeFr7jZf5A3/FX/ZtfoAf9d3jnzX72b3xnV563Xvq633tWeaYm9u5te9zuLU+ZzxPXTxq1NZmqZUvnPMUvlt56Sh9jjbqwxPmXqXUw8Oe0p/TxvQT... | code_stdio | abc344_b |
[
{
"content": "On the xy-plane, there are N points with ID numbers from 1 to N. Point i is located at coordinates (X_i, Y_i), and no two points have the same coordinates.\nFrom each point, find the farthest point and print its ID number.\r\nIf multiple points are the farthest, print the smallest of the ID number... | eJyVXEuyJDtSZcBCwmrciYX+EnP2gBnFApg8GHSPMMxYBKyPGevAz/HjEcq4eauLZzcrIvRxuSSX//X+82//+3//4W/43z/+j73807//+Jc//u0vf/7x98eP+vOP8zh//pEPe2t4K3j78afjx7/+5c9qVKz05x+Jfz/+40/H1r+jQ7aaw97q0fBWAMne1jGfkKzR/le/wFsGayYD1Je9nPV49WpQXnXMY6xhbyulY3VDdKFZNSivkcpRsgFLrR/5tPatzWMOb76OYq37rEed9vJqPR1tYPQzHzPZgCOv47UaxinnjNc0ko3eDI86rcdq... | code_stdio | abc348_b |
[
{
"content": "You are given an integer N.\nPrint all triples of non-negative integers (x,y,z) such that x+y+z\\leq N in ascending lexicographical order.\n What is lexicographical order for non-negative integer triples?\n\r\nA triple of non-negative integers (x,y,z) is said to be lexicographically smaller than (... | eJzVnU2y40hyhLXQQZ7VekxWnv+prXY6gczUOoA2LS1mVrIx0yGkg+iGqqZ/UVXkIwiABMma7kV0Z0Z4gqRHAMgMt/fff/+///x/f3f651/+6dt//Ot/ffn33//zL3/+8o8fX/Jvv3/508eX//jLnxn4+vHt399+/8PIJtnkP4w8J8/Jc8mDyYP5j/+TUWQUGUUOl8PluGTPZM9kl+zBL3/908dP11r2XevXj7J4ybLL+ZUnz2UPZg+WGx/ntNDlp5LnkgeTB/O1j3pC4RMnhyfH8fmzPbNdytUv5evCl3LhprXvTj99zovYtPF7P/+m... | code_stdio | abc335_b |
[
{
"content": "Takahashi has prepared N dishes for Snuke.\nThe dishes are numbered from 1 to N, and dish i has a sweetness of A_i and a saltiness of B_i.\nTakahashi can arrange these dishes in any order he likes.\nSnuke will eat the dishes in the order they are arranged, but if at any point the total sweetness o... | eJztm0uuJVlWRGlAj0G4sl1C5/+hwTiQSAZAJ6FR1UIl1SBgvpgt8xdB5ItSFB2EUJaUFffd6378nP2xbfvjf/rr//zbf/gr/vePf6MP//TvP/3LL//2h9//9PfPT+M5z/j5l/rMn3/pT/v5l/HUn3+ZT//5l59+9/z0r3/4/Xuhv/jj757/dmt7qq/lLv7v2xvq924oxf/9+Zvap5vW09d4xtLzWy9PP1q3zvE0lmnafdn60O9zfY7b9QD9W3WEcn98iHq8oWzLK859y3P2Pj//cu+dz73FH0tdjx6vC9rqXVua/thre+Y82vQ5sz+r... | code_stdio | abc364_e |
[
{
"content": "There is a weighted simple directed graph with N vertices and M edges.\r\nThe vertices are numbered 1 to N, and the i-th edge has a weight of W_i and extends from vertex U_i to vertex V_i.\r\nThe weights can be negative, but the graph does not contain negative cycles.\nDetermine whether there is a... | eJyFXD2SLrttdeCFdN1Yn4vgP7UIp3aVrxfg5MmBFLlU5UXY63Sm2AAOAKJn3rWfAg2nu0kQPwcHIOf+59//99/+6e/0v3/+H/7hX/7jx7/99u9/+fOPPz4/2tN//kZPfcbP3+pDz6fJ/7fnw79uPKZSfv724w/Pjz/95c/2yafyb/76h+c1S8UsBbN8++Yf//Ttm/EcfPOpfda9f/7Wn8GDWlevWNwfsJDP6WtXFmrIF7T2qiRfsKT3SX/WmGOpEONZZZ1S5ff0tLk2fdtI76fX800y3sEvtlG+vTufLbsYqjBV4C4N0n9onAHhP+PM... | code_stdio | abc338_f |
[
{
"content": "There is a grid with H rows and W columns. Let (i, j) denote the cell at the i-th row from the top and j-th column from the left.\nCell (i, j) is empty if C_{i, j} is ., and not empty if C_{i, j} is #.\nTakahashi is currently at cell (S_i, S_j), and he will act according to the following rules for... | eJztXcuOJLlu9cIfkhhuL4ip6uqeaa9zmasEEjDg9gd4Uzbgezc2DPgj7C/wjzojQudBSlE9uDvDlTOdGQ9JJA8PKYVCEfWff/vf//Y/f7N//v5fnxv/8O+//NP7v/zlz7/83eWX18uXH++vl5cf7xn5/Mrn1+N2vT9+vP/yp8sv//yXP7Pg6/PQf/zpYpXfLm8/3t+2E7lXfDZxtBE4cn08P/fH7X6d23ub2vt2+fbj/eVQZvv8eI8/+Ht/3G/X2+N222XdurC9zSbs66+Xr7/+eH/+vH59NpT4PLciuJl2/PgPn024n92/o9QL1FOd... | code_stdio | abc364_b |
[
{
"content": "For a non-negative integer K, we define a level-K carpet as follows:\n\n- A level-0 carpet is a 1 \\times 1 grid consisting of a single black cell.\n- For K > 0, a level-K carpet is a 3^K \\times 3^K grid. When this grid is divided into nine 3^{K-1} \\times 3^{K-1} blocks:\n- The central block con... | eJztnc2OJLd2hL3wxm8x6F4ZGBR8r38WehIDlh9Am5EWM6sLAd576we2/lqqWzV51MUKkpFxvgAhEH2G0ScOs6MoZjLrf/7xP//3n//pH/7rby/fffrhy+eXbz68/OXbTy8fP7x8/+Xzbz94fX399tPr5ef//Nx7+fHjh6t//tev/PNf8cugX9svQ3//6U8/uVze/sHP3cvNT/+M4SaFfz9MoQ+uStWnXV0UfXD1p9Knc2UVfTpdZ7ofcO8uuBJ9ecP9vwoLXV3efwTvroewUNeZfv3NyK+Dl7/3+LDQ1eLkj+Ddp3lYqOtMH1/7qSHc... | code_stdio | abc357_c |
[
{
"content": "N AtCoder users have gathered to play AtCoder RPS 2. The i-th user's name is S_i and their rating is C_i.\nAtCoder RPS 2 is played as follows:\n\n- Assign the numbers 0, 1, \\dots, N - 1 to the users in lexicographical order of their usernames.\n- Let T be the sum of the ratings of the N users. Th... | eJx1e8mS9ri2FQMe5IszvkFk3/AkRFAM1FiNZVmyZFmyCQJGPAG8L2s5E7hVdW6N/sy0ZWlr79Vsqf7Hv//f//P1393//af/jn/85//6D7/mtv/jPz7+8frHuosgnKjOP17+WEUK/vHxx1rXFqbH+x/rP/7l8Y/U9t/H71/jl//tXx7/5iBfz//65zEez09fH//6N4+3l5fvv478///8t+Gfn57+WHVUReR9wvjvGM1uOXS7T6cLZXF9fnx8Y8h5U+KSj/cvTPw8RVVpNecuj/x4/XrGIIfvKnb/eHv+fP5j9X6y1+PzCct2ouvNLevj... | code_stdio | abc354_b |
[
{
"content": "For non-negative integers l and r (l < r), let S(l, r) denote the sequence (l, l+1, \\ldots, r-2, r-1) formed by arranging integers from l through r-1 in order. Furthermore, a sequence is called a good sequence if and only if it can be represented as S(2^i j, 2^i (j+1)) using non-negative integers... | eJzNnc0OJTlShVnwHlz1gtUI+f+HJ0GieAA2BYuZFRqJN2AD78s5EXamHXGRCtHSMC1NV319rjOdaTsi7LDz3//6v/72P/5K/vcPf4M//OO//fbPP//1T3/87e8/v+VPnD9+/vaHz2//8qc/LlZ//Myf8uNn+YwfP8cnth8/Y/tE/CUOlf/5D5+jjPCJIRVbSvzx8/kPtz7PElqZreMPNQyUGWuZFX9OpdTSarNl4dLuRyeYcZRbQvKBMNc5W+q5B/wHVMmQzwyhxzlTLb0E/PvHT0twd6mOOWdoo6SWSsBzsEiqEPiLUmNug9dySOuZ... | code_stdio | abc349_d |
[
{
"content": "There are N people numbered 1, 2, \\ldots, N, sitting in this clockwise order around a round table.\r\nIn particular, person 1 is sitting next to person N in the clockwise direction.\nFor each i = 1, 2, \\ldots, N, person i has a name S_i and an age A_i.\r\nHere, no two people have the same name o... | eJx1fEfO9FqSnQaaaKYlEDVuCPRGG9AWBOjXgN57T0GAFiHtV+cETd56r/qvQb/Mj0leE8dE3GD/n//4//7zf/sP8u+//yf8x//4X/8ou2Fd/vFftX84f7qwKeNUs4w/XdRHmo3/G4dT32j4UxJuqRaYf7q0adJOc/HVP/5N+0e/Ls/P5cr7uuei535yM1z9v/9NU56GOy1hHRbhXJSaob//8Ju+LrXg/ffXp/Cvyi//1W2Tf7pd3q3FeTXtpOl/vdf3J/zmX90ob+dpSvto40+LuBrPf7rzX272Xvxc+rcbun+6q2xCzTE9x3J90/vT... | code_stdio | abc304_a |
[
{
"content": "Takahashi ate N plates of sushi at a sushi restaurant. The color of the i-th plate is represented by a string C_i.\nThe price of a sushi corresponds to the color of the plate. For each i=1,\\ldots,M, the sushi on a plate whose color is represented by a string D_i is worth P_i yen a plate (yen is... | eJyFvEmy7DjTJaaBFgL7x2WyG31ErULDMqvUgGgJgAAJgCAByGSmRUh70kxb0kG89/Ldhn8pv/xuRkOicbgfP8cJxP/5P//f/+//+j+9//lv/w9e/Pf//T+0X/L6H/+V/MeFnP/xUXCiohCe0CmLf3z/S/DhP/758UFOd/w549U//j/+C/mPOa+/772d35/9H/+FfG+QzVyQkHuLw9rfxH+81V79+uwff0Kr5PS9vfPpR2vvqwaMCPeQ08fPMRzcciVnDEESH3bNSQu6ql0SIfW+FJId37OiUvmZULIMUlkdYxazaANlYSKM785OW21b... | code_stdio | abc308_b |
[
{
"content": "Takahashi invented Tak Code, a two-dimensional code. A TaK Code satisfies all of the following conditions:\n\n- It is a region consisting of nine horizontal rows and nine vertical columns.\n- All the 18 cells in the top-left and bottom-right three-by-three regions are black.\n- All the 14 cells t... | eJztndtu41h6hRMgrxFA6H072CibkijlSQLEeYDcOLmYuQoGCJBXyAOnzM211vfTrm4fytUuFznTlkRy/4d12KIoivU///Sv//y///gP//bfv/3H/X/97a+//cvht5vr4eZyd99a68viJ7+zrmldW9b1sjy1rv/BOmZ6wTq/RDzs8njd07WMzcs67/gH60oxr1jXU9Dd/W9/Ofz2n3/7qwg53Nzdf/3z5e5+Psxfn3453H7d5+9/OYC16+H2ZpDBztrA5WWrazXr82XvsYwOxvLNvR1v7fdVq5/AYdP2zUVi3VD6Y9b1R8uPX0ci3ntd... | code_stdio | abc312_b |
[
{
"content": "Takahashi has a playlist with N songs.\nSong i (1 \\leq i \\leq N) lasts T_i seconds.\nTakahashi has started random play of the playlist at time 0.\nRandom play repeats the following: choose one song from the N songs with equal probability and play that song to the end.\nHere, songs are played con... | eJztnTuObMmSXSlwIIGSG4T/PxxJAywOgEqRQrdEEOAg2CIHRI1Dal/L/NyqzMj3BCpEA1H31qnMiPNxN7fPtm3mp/7nv/+X//u//53//OP/OT/8p//+23/547/98z/99h9fv9XX+P2P+ur857d/eP32X//5n55vxp4l5ZrPF//jH15/uaa/0u9/5Fd5+e/36/peu42Ryw/X5XT+iWvrq73627Vr7NHbmG/Xltc+/3DpvcfXC2efXLbeB8vpXDu99vVr2B6fP/nX7/kvv+W/fF7+cuVPdyg/nvX1TuWH7/72mMqXp39/7p9XlW9Xfj/n... | code_stdio | abc323_e |
[
{
"content": "There are N competitive programmers numbered person 1, person 2, \\ldots, and person N.\nThere is a relation called superiority between the programmers. For all pairs of distinct programmers (person X, person Y), exactly one of the following two relations holds: \"person X is stronger than person... | eJyNnUuuNEuWlWkwkFC2CxT28BcthoGEMwA6CY2qFiqpmgwA5kv4/r5lEclNKW82/pvnnAh3c7P9WHvth//bv/+///l//7v633+5Pv/nv/6vv/z3v/7Pf/nnv/yn11/Gq99/bc8//TXuv/7ln15/+R//8s/+sX1+8a//9Prjx8ff/fh/+OPn99f+fP7zz/7ann9yo8k//U9co7/ef+JT2/tPfay/ms/7Jx81z/uPPl4P5M7M+6/j+ecfrmbOV7s+3zhe7fPHfr3Gc7vt1T7/Gefr9Dqj1zKO1/j8Zrbn9/39/GrUho7X+Hx7bK/55iLH... | code_stdio | abc313_b |
[
{
"content": "There is a grid with N rows and N columns, where N is an odd number at most 45.\nLet (i,j) denote the cell at the i-th row from the top and j-th column from the left.\nIn this grid, you will place Takahashi and a dragon consisting of N^2-1 parts numbered 1 to N^2-1 in such a way that satisfies the... | eJzNncuuJTmSXTXQhxzkuCE4X05S39EDASrNpUm1Bt0TCQ3oI6T/bVvL6Kcj88aNR1VmlQpIVNy4/qCTRnvsvY3xf/7j//un//Uf/N9/+e/xh//6v3/5H3/+n//yz7/859cv409//uUfXr/807/88/mL8qqv9uqv+EW5X2W+ynqV/brjx/Gq/fWPr3q9ZvzUX7W9an3V8lrxY3uV+irlVa7Xjmf+6z+8vnhL++pb/vTnFY/rf/rzfN287zc3zU+HFpfHL2MwNYZ0v+p81fWqm3HEmPr16uXV66u3V3M0Mcq2X9239VdjkPGX5dXWq89X... | code_stdio | abc335_d |
[
{
"content": "At the entrance of AtCoder Land, there is a single ticket booth where visitors line up to purchase tickets one by one. The purchasing process takes A seconds per person. Once the person at the front of the line finishes purchasing their ticket, the next person (if any) immediately starts their pur... | eJztnb2uZMm2VjF4kKW2r9CK/wieBImDi4RzwLjXQlfiIeBJ8bAY44ud2equPi4WlaqK3LlzxVoRMf/nN2f9j3/7v/7Pf/43+fMf/jdv/uN//+2//P2//cs///bvn9/a0//29/epT3n/9vff/un57b/+yz///Ipf7L/9vTD89q//9PzhmsbnT3/WX1zCZ5nqj5eU9xkvf/hlfct5nzJHKeUpZ+6znj4YxjO633nGqLP0Z8wy63pWb+vMZ401S3vOKbXMP9+3LCf9299r/Rl/fh6v8zKee/PZf8afn9dxbtbZ71je/jP9Hx+fZ9t7nunU... | code_stdio | abc358_b |
[
{
"content": "There is a grid with H rows and W columns. Let (i, j) denote the square at the i-th row from the top and the j-th column from the left.\r\nInitially, there was one cookie on each square inside a rectangle whose height and width were at least 2 squares long, and no cookie on the other squares.\r\nF... | eJzt3U2OHNeen2EPvA6jUJoSF9QH74fW4AUYsLwATSgNyJEgwAvw0As2u6/a7dtug+GMkyfiX+/zEIEETzFZwd8bCXBC8L//x//yn//Hf/oP//W3158//vr50+uPL68fXv7808c//bN/ev3my49/fv3mH1///vXXdy+vv3z+9Mdbv3v54cvR7+9e/o/f7vuX7376+E9v+eabv1//+JZv/+nL/+Ytf/77HXz5Tt/8/fVP3/zjz//x9d+/kw//jzv55l/v5t++5f++k2/ff//yw9++/ZfvQoDYIWKHiB0idojYIWKHiB0idojYIWKHiB0i... | code_stdio | abc305_c |
[
{
"content": "Keyence has N bases worldwide, numbered 1 to N.\r\nBase i has W_i employees, and at 0 o'clock in Coordinated Universal Time (UTC), it is X_i o'clock at base i.\nYou want to hold a one-hour meeting across the entire company.\r\nEach employee can only participate in the meeting if the meeting time i... | eJztfUtuZbuynA3Y8xAu4N6Dwf/HIzHg6wG4c+zGey3DgAfhATsiM6jakhbvWpTq9qoOIOyztT5kMjMy8kPq//6H//qf/uO//3f/7X//7X/89b/+7V//9l/e/pb//ld9C3//K7/hU3qL4+9//e1f3v72P//tX3UBv/g///L2ckv6+1/xLeKeGOzfWwqfb9Jvvtza8KJobwpveHCMb/XvfxV+UfpbLPbgLyNo/ctzIm+Is7W3lD9f7r/4ekt4fzx+TvtZXj6PLz933399zuvTyuY5c/Pb8uWa+eXtX0f7dWxfR/X17bsZ7X6WL2//x2/5... | code_stdio | abc325_b |
[
{
"content": "AtCoder Shop has N products.\r\nThe price of the i-th product (1\\leq i\\leq N) is P _ i.\r\nThe i-th product (1\\leq i\\leq N) has C_i functions. The j-th function (1\\leq j\\leq C _ i) of the i-th product (1\\leq i\\leq N) is represented as an integer F _ {i,j} between 1 and M, inclusive.\nTakah... | eJztfUvOtstuFUgM5NNpR6juFwaRNhGhmQadc5CStCIkBsHgmAKzoK6uZbuebx8kGogUDbL3Pv//vvW6XL4sL9v//d/9x//5v/7tv/lP//Kn//Ln//rP//Sn//Dzp/iT/v7P1rT/9+N+7I9v/xL7v/j2L+4n/P2fvdn/6n9i+9e4/2hcf8/8pPFn/U/4GZ/2p7/5+dNf/vmf1hf83T/8Y/tP/+1vfuBLw/jg9rfs/D+O/k9oH+T6KfiH/O1f1Gc482PN3/85O+NT++7+7bX9a7ap/dM8TztLDKa2c7f/kH7yTxl/xcVoc/u3deD2T3X8... | code_stdio | abc310_b |
[
{
"content": "The programming contest World Tour Finals is underway, where N players are participating, and half of the competition time has passed.\nThere are M problems in this contest, and the score A_i of problem i is a multiple of 100 between 500 and 2500, inclusive.\nFor each i = 1, \\ldots, N, you are gi... | eJztnVmOJF3TlEFiHejVd41QZdbMSpBoFsBNOxf/L7mEkFgEi2JZdEYcM3s8qrvfHqqq64PMrs4h4hwfzM1O5OAZ+b/+3X/+9//n3/6b//I//vHfPv/3f/2Xf/ynv/5x+9fdp8+nm5ubv+6//H/88v/85cGnz91dnz5XdX+57vpy/Y//8Nc/6l//Zc37MuS0/f3jf/6Hv2Dv/q/7Ze90v4ytq/tldre43cxH62b6OcnPl7+bF94e/3r69Pl+Bf+N/8tNXOz3Kvcq9yr3KvfqZVyPnz4/fHH96fMX+G4/fT5/Lbrnm7+eLzjdCoMNl+fL... | code_stdio | abc323_c |
[
{
"content": "There are N players numbered 1 to N, who have played a round-robin tournament. For every match in this tournament, one player won and the other lost.\nThe results of the matches are given as N strings S_1,S_2,\\ldots,S_N of length N each, in the following format:\n\n- \nIf i\\neq j, the j-th chara... | eJy1fVuO5EisnQ14IcJ8XxmV70xvxAY8XoB/hv64FyBwYcCL8NK8IFeE4jwYyu6uR1bNdFWmHgzy8BxKKTFD/+c//bf/91//43/47//+1//853/927/+9V+Wv05//7Nm/v1PrO1XrH//89e/LH/Fv/0r1i/H5fC+8H//y2J73d73imz//f1Pvu/fX7zvndGXvL+KiLYkc+1L2s82QuSTUc7LbTkth+XyPtp1N9qxjdYGmnc7LMfdxo+3HtEP/XSgfs72jxnvyP+Q8W77h4xvtn/G+LD9I8Zh+yeM0/YPGJft1xs32y837rZfbbzYfrHx... | code_stdio | abc323_b |
[
{
"content": "N people, person 1, person 2, \\ldots, person N, are playing roulette.\r\nThe outcome of a spin is one of the 37 integers from 0 to 36.\r\nFor each i = 1, 2, \\ldots, N, person i has bet on C_i of the 37 possible outcomes: A_{i, 1}, A_{i, 2}, \\ldots, A_{i, C_i}.\nThe wheel has been spun, and the ... | eJztnU3ONcmSlBmwkNQdIxT/GcFKkLgsgMmFQfcItcQiYBHMWAMrI9PtMc9T3ELqKVK3uvurqu99T2ZGeLibm5nn+W//+n/8r//9r+J//v3/fP7hP/zXv/ynv/2Xf/yHv/y76y/jr3/rf/3bfdVztfLXvz3/OuKfx/X8W3v+d121xM88/7XX5y/ef/rr3/7yb66//Od//Ac+5fnBej1/85d/+jfXz4e/v+X/bfH/n/9S/u9ffv7D3/2mfqf8yU/rb/70x/vS//3zfqHfz03Vq6+r9+t54n3Vq1x9XP1q86o9nrZc7WrtetakXnVezzrt... | code_stdio | abc314_b |
[
{
"content": "Takahashi participated in N contests and earned a performance P_i in the i-th contest.\nHe wants to choose some (at least one) contests from these and maximize his rating calculated from the results of those contests.\nFind the maximum possible rating he can achieve by optimally choosing the conte... | eJztfVuuNL2yFEgMgQG09jP88qWujASJwwB42fBwzhM6EoNglIyCdkSmM+22ferjASRUW9r+1/q6u8rOS2Rk2NXrf/yb//hv/9e//lf/6b//7b/8/b/90z/+7T98/pb/4e8xhPA5vv+PKYR/+Pvf/t3nb//1n/5RXk/78deZ95DCdobrvO8cv2/553/3aa+Bj4fZNY7415ZyivcWzuvM+Tx+rhExj/6T/z5+//Gv0P5v+NnBbZ99cHDL+/4XP7n/w99TSp943p8U0+fars9+/17rPv46Qkr3daXtvq87/hrva4q0bdsnf+/72e7rs135... | code_stdio | abc327_e |
[
{
"content": "Takahashi has N teeth, one in each of the holes numbered 1, 2, \\dots, N.\r\nDentist Aoki will perform Q treatments on these teeth and holes.\r\nIn the i-th treatment, hole T_i is treated as follows:\n\n- If there is a tooth in hole T_i, remove the tooth from hole T_i.\n- If there is no tooth in h... | eJztnUuupUlynDXgQg5qTBDx8nhoJQLUXAAnRQ3IESFAi5BWorVwxsUo7DOPk8nORqOnAorF6sq895z/EeHh4W5ubvG//u7//Mf//S/833/79/uH//5vv/3T7//jX//lt//6+a2Xz/zT7+1zPnV/2tL/nj/9/tvff37753/9l/xM2/cn//PvPz99rX7Wn36vn5/++fMvlV++cz7t/vB84n688c+91/3f+pn3f+f9+f6s+2/cn+4/v1z8crlWymeUe8U6zqd/zvz0/hn3cmN+ar232J967mvdN+z3+e5vQr+4d7+/Wf3+4t7+vvP9xqqf... | code_stdio | abc350_b |
[
{
"content": "You are given a grid with N rows and N columns. An integer A_{i, j} is written on the square at the i-th row from the top and j-th column from the left. Here, it is guaranteed that A_{i,j} is either 0 or 1.\nShift the integers written on the outer squares clockwise by one square each, and print ... | eJztvVuuJM2WbgUSDSnV8xEyQ1UHiZYg8dMAXjY8nPOEjkQj6BstoB9UrvA5xpieWSX2/otFKVV5iYu727x8F1sRHha+/o//5n/8v/7v//q/+p/+97//X/7yv/3n//T3/8Pf/f0//PGXc8/94y/3ub3/dHv+6c8ff/n7//B3f/+//uf/9Bz4T7vPHHXmqH+6/fv/8h/+LvH+ux/HfP6/xs/Wffw/fvKfr7uvCv4p+I9nz91n3w51qPg8R14G/Dj+/LKq889W9fPx//hB4mnyQcdyfmz8uarPgPsZ8OPImwG/rOoT6uvPV7r7dTfdfzae... | code_stdio | abc309_b |
[
{
"content": "You are given N strings S_1,S_2,\\ldots,S_N consisting of lowercase English letters.\r\nDetermine if there are distinct integers i and j between 1 and N, inclusive, such that the concatenation of S_i and S_j in this order is a palindrome.\nA string T of length M is a palindrome if and only if the ... | eJy8vbmuZU16HShDD0KUTYNUg92gHkJ2N5ROzPM8R6MBufLktKtn1YpDSqBYJCvPBapuoRJ/3txxdgzft4aYzn/59///f/vv/+7z83//V/zHf/5//2BiHv0P//Gv/vB3vyKhvyJjQv6KnOBvv6IUv+If/vqv/pBG/8en/h/R8Kv/76//6p+U/D8+z9JXnvzz5/9T+qPH/wMe/PbnB0X+qCr/StXZp+KMfxrxpyv/f/6K+Jj5K/pfcf2K9VfMv+L+Fd2veNFhv2L4FfuvaH/F8itqfPyvqD4fjc8yvyI69PyKAz386bH4G6/8u7/BB33x... | code_stdio | abc307_b |
[
{
"content": "There is an N \\times M grid and a player standing on it.\r\nLet (i,j) denote the square at the i-th row from the top and j-th column from the left of this grid.\r\nEach square of this grid is ice or rock, which is represented by N strings S_1,S_2,\\dots,S_N of length M as follows:\n\n- if the j-t... | eJztfduOLceRnQH7Qxodr0TikJzhjPQlBix/gF4oPZBPgmB/hD/YZ3pXRqxbVh8BY3mT2FtidVVlZlzXisysfTn/+7/99//1/X/9L//jb+9//vmvv/7y/se395/efvrTz/Xx+vp3fX19/K3r79cTvH/1e//u7f0vv/5yifj+h693/v7dG0j94fu3H/519w+vS+S8vt57HEPTx/8XN13993/U1ENWu/MfXahpPN03oYM2QYdp+rhGRVFgbJIX+3Vq0qEcqOqDCWzvJ6kUqt0edO32j9SzhShQjaam4C9gKWKD4fXD9/9q+Prx7ccPCR9Q... | code_stdio | abc311_d |
[
{
"content": "You are given two strings: S, which consists of uppercase English letters and has length N, and T, which also consists of uppercase English letters and has length M\\ (\\leq N).\nThere is a string X of length N consisting only of the character #. Determine whether it is possible to make X match S ... | eJzsur2ObUl2pDlCy/MMiSuXwCo2m93UmhUSASdQAhdYMaVSoJJFgFUSQWAeZF5q3mgyM/Za9tnyfadJrQWzjBvnnL3d14+ZufuOiPy//8s//r//z//5f/xf//btn3/8lz//6dvf/PDtr3/4yz/8+D//9rd/+9O/X9784cdvv/rh2x///KdnwO//6V9/uvTvv/rhnvS3v/3epL//4zXn17/54Td/+PEff/+Pv3z9/vf/+PufP/1Hsv36h1//4cff/eHHv/+PZPl57N+/jH0L/JdPG8+3//WE//pM+M/O+M/k+PVf/vBXX4p8/M+fv356... | code_stdio | abc329_e |
[
{
"content": "There is a grid with H horizontal rows and W vertical columns. Each cell has a lowercase English letter written on it.\r\nWe denote by (i, j) the cell at the i-th row from the top and j-th column from the left.\nThe letters written on the grid are represented by H strings S_1,S_2,\\ldots, S_H, ea... | eJxsfVmS5TiynT60kLT+lpm6OmtKrURmih8CBDhgIIiBACGTmTahnWlBOnDHzSer6nqvIzIiLkkM7sePO4DD//2f/8/v//c/0X///b/iH//jf/7j8KHkf/y3b//4/dvvX/7Z2hbKl1+caSZ9+b4bEcKX319zePPlVfLFKPw+2EefX/4f/+XbP66S5y1++/avL//bt+/jy6/jy2/jC277j//1X779f4+iP6iO/3AnQ99UL308r3ff6dv46a93x1W/jht/H4/413jYL99++dvdf/nnt1/++eVNUqokhfZ+eXzHv9B4P35vlFH4GQ+g/iRv... | code_stdio | abc302_b |
[
{
"content": "You are given two grids, each with N rows and N columns, referred to as grid A and grid B.\r\nEach cell in the grids contains a lowercase English letter.\r\nThe character at the i-th row and j-th column of grid A is A_{i, j}.\r\nThe character at the i-th row and j-th column of grid B is B_{i, j}. ... | eJzsncuuLUt6lUHiDXiBo2q7UWV8jMyTILE6cb/f74GQaPHcjNhYiKpyB+wGiJSOdtXea66ZmRH/P8Y3ImPO/K//5j/+2//2r//Vf/rPfzAxj/6H//DbH/7dTySU/UQu5E9U2vzjX+n//Osf/ua3P6TR//Hlf/vbn/BP/+Vvfvtf3gL/gheXv3zpn/6pl/7xJwqz5QhEmf4TZ09ZU5Gl+Il5U6laYUP9xKHyUL3ti3elU+p9hJYO/16OXD0oX3+iJaaLKIvBawhbc8gs58S/a8K58nkS/Dthu50yk/0/P276Zx73z0fl99/+4Z8YFQxL... | code_stdio | abc351_b |
[
{
"content": "There are N roulette wheels.\nThe i-th (1\\leq i\\leq N) wheel has P _ i integers S _ {i,1},S _ {i,2},\\ldots,S _ {i,P _ i} written on it, and you can play it once by paying C _ i yen.\nWhen you play the i-th wheel once, an integer j between 1 and P _ i, inclusive, is chosen uniformly at random, a... | eJzMvduO9FjOHTiYGb+H0NdGQ+Q++0kMuF5gbmrmwr4yDPjRR1xrUdqKzK+6Dl/3353V+UVGKKR94OZxkfzf//d//b/+0//5f/y3//m3/+fX/+9//Pe//Zfjb+Ww+suvdp6HH+1Yv/zazqMedv1Vj/nLr+O83o3Xfsz4+2//+fjb//s//ru+7Nb+vqyU1ko766pl1tFb93Zd+L/+87E9xo/rEddzrvtc/48HHv047x98+L53P7/e5DzW9W7x5sc6ToxqHOX6Hf+/puFWx3V/++XXepZyjZhzGZhDO+K7Y7XryfHDb11jKavGNTHLin+v... | code_stdio | abc314_e |
[
{
"content": "There is a simple undirected graph G with N vertices labeled with numbers 1, 2, \\ldots, N.\nYou are given the adjacency matrix (A_{i,j}) of G. That is, G has an edge connecting vertices i and j if and only if A_{i,j} = 1.\nFor each i = 1, 2, \\ldots, N, print the numbers of the vertices directly ... | eJzsvcuy7LqOLeaG/R8Zu10NUW/5Sxzh8wPV2deNqlZFRbjhT/WH3CmRIAGMAUq59muuuzLynLVzZkoUHgMgSCkx/t///f/6//7//+N/+7//67d///3/+c//+O3/fP02/+v34ZW+XsO/fv/65+uV5M2Qv7re/PZvr9/+x3/+RzlpfE3nQV/nfh08fn373//2UmOO54lD+cee+a/f4ehFLpPapVM5vQlkZCvyeqHm11LEuv475j+n8wN3zWNpw/+Ur4/4H/E/4v+Ur4/4H/E/4v+Ur4/4H/E/4v+Ur4/4H/E/4v+Ur4/4H/E/4v+Ur4/4... | code_stdio | abc343_b |
[
{
"content": "You initially have an empty string S.\r\nAdditionally, there are bags 1, 2, \\dots, N, each containing some strings.\r\nBag i contains A_i strings S_{i,1}, S_{i,2}, \\dots, S_{i,A_i}.\nYou will repeat the following steps for i = 1, 2, \\dots, N:\n\n- Choose and perform one of the following two act... | eJyMvdkO7EiyJCYM9BV6cvTzCOjaq/QlAqZeGMF93zdBgD5d5kFmumUe1r3d1XUqTyYZi7u5uXmQDP5///v//dP/8T/+t//1//yraPtl/tf/Jf+KnI+Tv9tf8H+JHP7v9d/47/ZXScWLj+U64GdJRP/7r/8p/+qW+T77Z3zx//5PeWzv57s9bVmbun74SX5o5P/86cdWosjhfx7/+7v9PbQV4f+Rfopj/D9+tY/jdKzO4QA9Q/8QPVMP8NprGAAa0n+vP/z3CH79YQBd1UdN6rNkKucpW9o0nftsr4+mGt1an+fRRF1Z9WWxVIdvoz7a... | code_stdio | abc344_d |
[
{
"content": "Your computer has a keyboard with three keys: 'a' key, Shift key, and Caps Lock key. The Caps Lock key has a light on it.\nInitially, the light on the Caps Lock key is off, and the screen shows an empty string.\nYou can do the following three actions any number of times in any order:\n\n- Spend X... | eJzssrHOZdlypCdDTyBbRqNtGpfiSIDo5TPIEaDrpDnO5RikRQygR9edqRVfRO6/BA0gbxDRXVXnnL1WZsQX+//+H//P//n/+J/+h//r3//8j3/7T//2r3/+8x9//uMf//THP/31bzM7f/3bn//wx5//8m//+h7973//4T//wx/n8N//+8tf/vq3nf3Nhf/tNxf+lz/+w9+P/9fzOzO//v37p/319ceM//CX32/9+5Dv0X/8/3/yx/r/l5N/kf5+ZX+M/6ffXeLKf93z89L/+v9xKVbuf9PKuHtv/8gYD/+bh/wkpYe/Qfa7GN9EVVVV... | code_stdio | abc303_d |
[
{
"content": "We have a grid with H rows and W columns.\r\nLet (i,j) denote the square at the i-th row from the top and j-th column from the left.\r\nEach square in the grid is one of the following: the start square, the goal square, an empty square, a wall square, and a candy square.\r\n(i,j) is represented by... | eJzEvUuSLMeRLdiDHvQyrkCnfCYEWO9VsTbABXDSIo0N1ARZA3JUUiK9uF5YIzNcz8f+5uGJ58DNjDA308/Ro2qaER4e/+//+X//f//yf/0f/89//fQfv/3nP//x07//+OkvP/7y43/++tvfy99+/e0jPn79rUT59bef/vTjp49//uOa8/PvA//9px/Vqp+vVeVz1Ue76n+0y/7nj5///OOXP38dn6s/Svn4+P3H70K+Hhd5PBn/W2PgvzWqfn5Z+PG3v9eT/9ydC6s6K1pHfv7xy19/+fHzLz9/WnXZuDg+mgfLmTvnltJ8mk3/MLtf... | code_stdio | abc301_e |
[
{
"content": "There are N people numbered 1, 2, \\ldots, N on a two-dimensional plane, and person i is at the point represented by the coordinates (X_i,Y_i).\nPerson 1 has been infected with a virus. The virus spreads to people within a distance of D from an infected person.\nHere, the distance is defined as th... | eJzsvb+O7Uqz5CdjHqTx2ZPAIot/ZeoBxpag5cqQ810BmrEEAbL11GJG/KLO7qN75QkjXdDY7HP27q7mIqOqsjIzIv6P//Df/3f/53/4b/7H/+0f//M//5f/8p//8d/+/GP72b//XH9q+f5z/DyX6+f6/vPTf/mP//jzj3/5L/+Z7/sf/qf/9ftPXf7Tv/Af//jf/+PPHyPpxz8/n+8/a/l8Pj+6fv+p//Z//isj9mD9529j3T9b38/6/eehW1t+jv7P567qudfx/ef+M3Tbui59Of4fx//r9v92+Vd++TI/yL8y4N++d9Wny0d+fuS+... | code_stdio | abc304_c |
[
{
"content": "There is a grid with H rows and W columns. Let (i, j) denote the cell at the i-th row from the top and the j-th column from the left. The state of each cell is represented by the character A_{i,j}, which means the following:\n\n- .: An empty cell.\n- #: An obstacle.\n- S: An empty cell and the sta... | eJzsvctuLEmuLdiDRo/7ExyyacLh70fN+gfOpHLQhd7TGtREWUBljgoF3E9v0h7kovkjXDt1ruzqGnOn5A8zGrm4Fi0iFAr9j//z//1//q//+//4//799o/3f/7x+9tfmrepmX68/7Vt2x/vrm2d/0rHdPjrj3e61Td9M/K3sZl/vI/N0PQ/3gc6o29vvzRvv/3xe/T0t7//iy7955cGvA/NwN5/vP9K//fsZuD17MT/+u0wb+LFKAYfyl+d42/O/eoD8/GNHEvPo9jlyCEND0Pquob+j56+gVHJvoe136km7Vej+Un2nWry1Vh+klWd... | code_stdio | abc348_d |
[
{
"content": "There is a grid with H rows and W columns.\nEach cell of the grid is land or sea, which is represented by H strings S_1, S_2, \\ldots, S_H of length W. Let (i, j) denote the cell at the i-th row from the top and j-th column from the left, and (i, j) is land if the j-th character of S_i is ., and (... | eJzsvc2OJEuSrMcFH6RQum0Yprvv9Pysa1mrAgogwH6B2ZyZRfdqMMB9Sj4Ll8zMCBX5RM0iy3vm8oLgdTunMiPczfRHVETdPcIj8r//7//H//1/ff3f/s9///ovv/3bX//y9Z+/fP3Tl3/48vd//u37z+/ffvz5t3qMtwdrrVrvDz4efWz5eBS7npO//u7L13/961+eFv/wtuE/fvcFPn7/xy+//9OXf/rzbz+///zx7f2fFms8PNWHl/fnTwcfT9eSy48pHxNqIdDnnEegH7u08WH5sWI9PPSc90mPiR3P0wjzXM89irCeDotznlGc... | code_stdio | abc341_c |
[
{
"content": "You are given a strip of paper $s$ that is $n$ cells long. Each cell is either black or white. In an operation you can take any $k$ consecutive cells and make them all white.\n\nFind the minimum number of operations needed to remove all black cells.\n\nInput\n\nThe first line contains a single int... | eJyEvTuSY0uwZUeBIgdx7MktJP4AxZhEtFnnBKgkKXRLNJpxXBwPB0IcAL7X8kA9Y926mQBOfNz3Xjsqv8D//T//1//n//1f/qf/9n/+x//293/8j//+H//r9h/337/rdvr9m2POOX7/bq87z3vP+79/l+38+7ffHvvty/P2/uf3774dP4+/7h5+9vvPO5+/v3/n7fAe/Pt3el3bV/uP/7L9x//+P/77Z+fno88x77fPXU6vtz/PUf/Xf9lU4HHf+fTabV/4sd32hffyXqt/rXlc5l/2OXsxc77/fip6zb5+apv7nVfNbxV0s29wqor3... | code_stdio | 1873_D |
[
{
"content": "You are given a string S consisting of three different characters: A, B, and C.\nAs long as S contains the string ABC as a consecutive substring, repeat the following operation:\n\nRemove the leftmost occurrence of the substring ABC from S.\n\nPrint the final string S after performing the above pr... | eJzsvEuSZEuOLMYBV8AN8EqOawU9A7AJirA30JPqHlSNWlqEm+L+mOkG/cCjKeToDZ6oATdvhPs59gEUCpgd9/i//tf/43/7v//3/+X//M9f//b3//jnP379y1+/uqqnZ37/W/Ovf//1t79+/fs//4E332v/9be/7I4/V/aPS39eVu/CP/r+143Bpt4Pv3/87ufPO/3nkp8d/rj0v5va//e8+kc//eOi3/P9b2zxs68/a/q9jN9zfvJH/6yrfhvu93t/3q/38+91zZ+F/3n3XfyxeP255M8bnwv/3PHn5u3y8//+c9l83utnuh0EWp+L... | code_stdio | abc328_d |
[
{
"content": "There is a race through checkpoints 1,2,\\dots,N in this order on a coordinate plane.\nThe coordinates of checkpoint i are (X_i,Y_i), and all checkpoints have different coordinates.\nCheckpoints other than checkpoints 1 and N can be skipped.\nHowever, let C be the number of checkpoints skipped, an... | eJx0vUvOLcuxpKeGAE1j47YLRMbTI9TVJAqoMwF1KDWqWoIADU/DUthnHpmLh1dskIv/XisfEf40N/f4f/7n//r//m//y//03/6v//jf//l//o///h//65//mH/98/nz/PXP8qf89c+qT48+FX2q+vQf/+XPf/wf/+O/59fHP1ZdvUapPfos+3l2jHa+9X//lz8/Vy1ccf31z/Yn/vrn/tP/+mf/s//659QV4894b9r0t6X/6n+/Ve3/mK330mYZZcYeK+qo//m9Wv9TdY/4M/X/nj9N71D/7HP3FX+2btP/9POyq/4ZunPXg5XgZ+ch... | code_stdio | abc315_f |
[
{
"content": "There is a grid with H rows and W columns. Let (i, j) denote the cell at the i-th row from the top and the j-th column from the left.\nEach cell contains one of the characters o, x, and .. The characters written in each cell are represented by H strings S_1, S_2, \\ldots, S_H of length W; the char... | eJzsuk2uxUeu3NmDXoig8XOiPoweeCUNuDbgSdGD94ACDAPeQm+rV9Ul3UPyF0EeVXtOSrr3/5FJBoPBzLzn6H/9n//3//P//qf/47/+j1//29//+3/8+6//5Zdf//rLf/7lr3/7+z/i/eNvf38v3j+v//Hib3//9d9++TX+498/w/7yzwf/899+wcT//Mtffpv421D+p9P+NKb99Ze//h7vvd/C/RbzH89n/ac/j2l//tMvf/7LL//Xb3N+s3/Cjd88/OO369+fxOcu7SeZfPuZF/G5ixr3W/T4Z8L//O+fef+Q8DPzt0fp5bdxP3ev... | code_stdio | abc337_d |
[
{
"content": "Slavic is preparing a present for a friend's birthday. He has an array $a$ of $n$ digits and the present will be the product of all these digits. Because Slavic is a good kid who wants to make the biggest product possible, he wants to add $1$ to exactly one of his digits. \n\nWhat is the maximum p... | eJx0nU2yLVuOlGnQpcMIlmWbRvxHLEaCGXcCdBIaRQvDjNkwTc4J90+uuGlYkkXVefvtHbF+JJfkcv2ff/9f/u9//A//7r/+r3/8t3/+j//5b//4z+Mfx59//vy/bWxjHduff+5//rnofzt//sHYf/6+j58PzJ//N/76z59//uM/jX/89//5b/6q9fr5op9/a3//x3Jc97YuPx/63/9ptB9c3w9dY/2Xf33710/2R/vXH/vr89v7zdvQ/7+O5+9/5+dfWa+//qWfF/753Dl+3/UZ589/3vd9ftdh+fm/5s9/75+/3T//7vvnvx5jbsvy... | code_stdio | 1873_B |
[
{
"content": "Takahashi is health-conscious and concerned about whether he is getting enough of M types of nutrients from his diet.\nFor the i-th nutrient, his goal is to take at least A_i units per day.\nToday, he ate N foods, and from the i-th food, he took X_{i,j} units of nutrient j.\nDetermine whether he h... | eJyM/buudVmztQlh4HAXS79dxujn3usisEF8LgZOFhJVFkKCm+R6qj1PzNy/UDloa2d++b5rzTlGP8ShRYsW/+///f/p//v/+T/87/4v/8//9n/75//+v/zP/+1//Ptv/W/855/2/fXvb3z/+Sf/+v5a/gf/9P//889/+x/+/tv/9L/8z79f+D//X/8f+aP/1//w9//zIfO/f8jf/O+f42f+10f9/W8+7P/4P/1vPmuM+tbVepvf/Jt7zZ1PXefb66y/tb87v/23+ve97/2t9rV+863nrdva3/rGGvf+rbm+OfNzb3xr5s/Herftv3nX... | code_stdio | abc356_b |
[
{
"content": "Takahashi and Aoki played rock-paper-scissors N times. [Note: In this game, Rock beats Scissors, Scissors beats Paper, and Paper beats Rock.]\nAoki's moves are represented by a string S of length N consisting of the characters R, P, and S.\r\nThe i-th character of S indicates Aoki's move in the i-... | eJyEvUGObMuybUWBBtCEr1dG4n8ECNEKl68KEq8DVB4U/i8hJLpHr3iZETbGsJVHYp9zMiNW+DI3m3NMv3fvnRn5//zX/+t/8//+d//V//Z//cv//m//53/5z//yv/yHf/mf/vXfzn2e+/zrv/3Lf/sf/uX/+C//+fvC//jvF/7v//Y/ZOl/+o//+m8Pv/7/1//3/8O/rz/3PPfn1/n3R//++N93+tnvffd/+p//3v4ff37967/93Pvvd5/fAr9l/v2/+338rfv7+VwefT7fWXdnYQrw2ueGM3W+pQ4fL/ecb9FP+Xl46OT7z7cNHtMO... | code_stdio | abc365_d |
[
{
"content": "We have a grid with H horizontal rows and W vertical columns.\r\nWe denote by (i,j) the cell at the i-th row from the top and j-th column from the left.\r\nEach cell in the grid has a lowercase English letter written on it. The letter written on (i,j) equals the j-th character of a given string S... | eJyMvdvO9MySrcUBl8AFTPXxOmB1iwWLW0DiGESdlO10lSvt9Cad3iEk7o7bIjye8NsNC4mev+ac3/9uXHZmZMQYI0b4+z//6//lf/q//pv/6n/73/+pS1NZ/+l//Mc//fM//uWVcsqvFEp8pX/6D//4p7Gs/s3/NdjX/+n/+A//+H/8wj+/0rt6pbr5f//4/zz+Fz/93/3jv7fLx5JysKunEkNO5aX/D9H+YB+d7Ev2FfvXeH/l33kH9++8/30/zj3kFPRB9py5FPuxXFIMUV9JMSW7vRADXykh283c37Jvxntd7vsOKd2fm4rd/f0s... | code_stdio | abc308_d |
[
{
"content": "You are given a simple undirected graph consisting of N vertices and M edges.\nFor i = 1, 2, \\ldots, M, the i-th edge connects vertices u_i and v_i.\nAlso, for i = 1, 2, \\ldots, N, vertex i is assigned a positive integer W_i, and there are A_i pieces placed on it.\nAs long as there are pieces on... | eJxsnUmObllynDXQVHsI5JiD0zdciQDFBjgpclAcEQI008a0MB23z/y+giiQqMx8L+L/7z2NN2bm7v/rv/73//1//tt/+R//8de//O3f/v3vf/3zz1/rZ/3+rf6037+1n/77t/5T439G/Nn8/duMv70/769+6s/gj4v/7/3gX//089e//vvf/VHv5//6n//08w8f3uKH9OH6n/db/+/vlP/0O7X8tPen4+fEb9US/7vjSW48Sfz30f/ueL4aj7TjwU/8UItfmvE/I75vxtfv+LfDu434txt/Fp+gF27z5/1Y/N96/3LfD/60qkWYP/3+... | code_stdio | abc341_f |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.