problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p02549 | u407778590 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N, K = map(int, input().split())\n\nidou = set()\nfor i in range(0, K):\n L, R = map(int, input().split())\n idou = idou | set(range(L, R + 1))\n\nidou = list(idou)\n\nmoves = [0] * N\nmoves[0] = 1\nfor i in range(0, N):\n for j in range(0, len(idou)):\n if i + idou[j] < N:\n moves[i + idou... | ['Wrong Answer', 'Accepted'] | ['s264836860', 's176160941'] | [38068.0, 26824.0] | [2207.0, 1433.0] | [367, 491] |
p02549 | u469254913 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['# import numpy as np\n# import math\n# import copy\n# from collections import deque\nimport sys\ninput = sys.stdin.readline\n\n# from numba import njit,i8\n\n\n\ndef give_dp(N,K,mod,LR,dp,l,r):\n for i in range(N):\n if i > 0:\n dp[i] += dp[i-1]\n dp[i] %= mod\n for k in range(K... | ['Runtime Error', 'Accepted'] | ['s585078445', 's628128833'] | [16920.0, 17044.0] | [251.0, 882.0] | [944, 958] |
p02549 | u521866787 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['n,k =map(int,input().split())\ns =[]\nfor i in range(k):\n l,r=map(int,input().split())\n s+=(list(range(l,r+1)))\nS= set(s)\nprint(S)\n\nmod = 998244353\n\n# How many are there to climb\nstep = [0] * (n+1)\n\n\nfor i in range(1,n+1):\n for s in S:\n if i+s<=n:\n step[i+s]+=1\nprint(step[n]... | ['Wrong Answer', 'Accepted'] | ['s525698265', 's096764097'] | [29748.0, 25148.0] | [2207.0, 914.0] | [301, 515] |
p02549 | u539969758 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N,X,M = map(int,input().split())\n\nans = X\nA = X\nTF = True\nsrt = 1000000\nretu = dict()\nretu[X] = 1\nloop = X\nfor i in range(N-1):\n if TF:\n A = A**2 % M\n if retu.get(A) != None:\n srt = j\n goal = i\n TF = False\n break \n if TF:\n retu[A... | ['Runtime Error', 'Accepted'] | ['s870203673', 's997285547'] | [9184.0, 24488.0] | [26.0, 1517.0] | [544, 447] |
p02549 | u545368057 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['n, k = map(int, input().split())\nls = []\nrs = []\nps = []\nMOD = 998244353\ns = set()\nfor _ in range(k):\n l,r = map(int, input().split())\n for i in range(l,r+1):\n s.add(i)\ndp = [0] * (n+1)\ndp[0] = 1\nimos = [0]\nfor i in range(n):\n for d in sorted(list(s), reverse=True):\n if i - d >= ... | ['Wrong Answer', 'Accepted'] | ['s140648310', 's448209820'] | [27936.0, 24756.0] | [2206.0, 1141.0] | [404, 334] |
p02549 | u632395989 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N, K = map(int, input().split())\nS = []\nfor j in range(K):\n S.append(list(map(int, input().split())))\n\nm = 998244353\n\nprint(S)\n\ndp = [0] * N\ndp[0] = 1\nsum_of_region = [0] * K\nfor i in range(1, N):\n for j in range(K):\n if i - S[j][0] >= 0:\n sum_of_region[j] += dp[i - S[j][0]]\n ... | ['Wrong Answer', 'Accepted'] | ['s663842231', 's156399991'] | [134228.0, 16856.0] | [2412.0, 1339.0] | [503, 507] |
p02549 | u686036872 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N, K = map(int, input().split())\n\nDP = [0]*(N+1)\nDP[1] = 1\n\nS = []\nfor i in range(K):\n S.append(list(map(int, input().split())))\n\nS.sort()\n\nfor i in range(2, N+1):\n for l, r in S:\n DP[i] = (DP[max(i-l, 0)] - DP[max(i-r-1, 0)])%998244353\n DP[i] += DP[i-1]\n\nprint(DP[N]%998244353)', '... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s045192540', 's187294529', 's247222194', 's291847586', 's303687949', 's990556771'] | [13768.0, 16840.0, 19732.0, 20024.0, 19400.0, 16900.0] | [1061.0, 1092.0, 1178.0, 1162.0, 724.0, 1121.0] | [298, 302, 289, 289, 334, 314] |
p02549 | u686230543 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['import numpy as np\n\nmod = 998244353\nn, k = map(int, input().split())\nleft = []\nright = []\nfor _ in range(k):\n l, r = map(int, input().split())\n left.append(l)\n right.append(r)\ndp = np.zeros(n+1, dtype=np.int)\ndp[1] = 1\nfor i in range(2, n+1):\n for j in range(k):\n dp[i] += dp[max(0, i - left[j])] ... | ['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted'] | ['s407253943', 's834274718', 's703775323'] | [28236.0, 28388.0, 16780.0] | [2206.0, 2206.0, 1453.0] | [416, 369, 382] |
p02549 | u719840207 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['root=[]\nn,k = map(int,input().split())\nfor i in range(k):\n x,y = map(int,input().split())\n root.append([x,y])\n\ntoori=[0]*(2*10**5)+[0]*n+[0]*(2*10**5)\ntoori[2*10**5]=1\ncum=[0]*k\nfor a,i in enumerate (root):\n s=0\n for j in range (i[0],i[1]+1):\n s+=toori[2*10**5+1-j]\n cum[a]=s\naaa=su... | ['Wrong Answer', 'Accepted'] | ['s550646818', 's944369894'] | [18236.0, 21516.0] | [61.0, 773.0] | [332, 639] |
p02549 | u736470924 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['def resolve():\n n, k = map(int, input().split())\n S = []\n for _ in range(k):\n l1, r1 = map(int, input().split())\n S.append(l1)\n S.append(r1)\n S = list(set(S))\n\n dp = [[0 for i in range(n + 1)] for j in range(len(S) + 1)]\n for i in range(len(S) + 1):\n dp[i][1] =... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s598533061', 's866113129', 's064404608'] | [58604.0, 58792.0, 24412.0] | [1077.0, 1075.0, 667.0] | [593, 606, 660] |
p02549 | u759412327 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N,K = map(int,input().split())\nLR = [list(map(int,input().split())) for k in range(K)]\n\ndp = (3*N)*[0]\ndp[0] = 1\ndp[1] = -1\n\nfor n in range(N):\n for L,R in LR:\n dp[L+n]+=dp[n]\n dp[n+R+1]-=dp[n]\n dp[n+1] = (dp[n]+dp[n+1])%998244353\n\nprint(dp[N-1])', 'from numpy import *\nN,K = map(int,input().sp... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s035350556', 's568123396', 's976971097'] | [26164.0, 32868.0, 26036.0] | [1375.0, 2207.0, 817.0] | [256, 322, 254] |
p02549 | u763550415 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N, K = map(int, input().split())\nS = []\n\nfor _ in range(K):\n L, R = map(int, input().split())\n S.extend(range(L,R+1))\n \nprint(S)\n\n\nDP =[0]*N\nDP[0] = 1\n\nfor i in range(1,N):\n for j in S:\n if i >= j:\n DP[i] += DP[i-j]\n \nprint(DP[-1]%998244353)', 'N, K = map(int, input().split())\n\nL ... | ['Wrong Answer', 'Accepted'] | ['s749710979', 's058759485'] | [19488.0, 16848.0] | [2206.0, 1045.0] | [258, 379] |
p02549 | u802180430 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['n,k = tuple(map(int,input().split()))\nboolean = [False for _ in range(n+1)]\nfor _ in range(k):\n l,r = tuple(map(int,input().split()))\n for num in range(l,r+1):\n boolean[num] = True;\nFINAL = [i for i in range(len(boolean)) if boolean[i]]\ndp = [0 for _ in range(n+1)]\nfor i in range(2,n+1):\n for lower in ... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s186051921', 's314456877', 's921173046', 's910886078'] | [19840.0, 12212.0, 9060.0, 16808.0] | [2206.0, 2206.0, 31.0, 1129.0] | [460, 381, 497, 521] |
p02549 | u811436126 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['import numpy as np\n\nn, k = map(int, input().split())\ns = [list(map(int, input().split())) for _ in range(k)]\nmod = 998244353\n\ns.sort()\n\ndp = np.zeros(n * 2)\ndp[1] = 1\n\nfor i in range(1, n):\n for l, r in s:\n dp[i + l:i + r + 1] += dp[i]\n dp[i + l:i + r + 1] %= mod\n\nprint(dp[n] % mod)\n... | ['Wrong Answer', 'Accepted'] | ['s453202053', 's804689381'] | [28404.0, 24556.0] | [2206.0, 836.0] | [301, 454] |
p02549 | u851125702 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N,K=map(int,input().split())\nx=998244353\nS=[]\nfor i in range(K):\n l,r=map(int,input().split())\n S.append(l)\n S.append(r)\nS=list(set(S))\ndp=[0 for i in range(N)]\nprint(S)\nfor i in range(N):\n for j in range(len(S)):\n if(i-S[j]>0):\n dp[i]+=dp[i-S[j]]\n dp[i]=dp[i]%x\... | ['Wrong Answer', 'Accepted'] | ['s795327876', 's309685160'] | [20488.0, 24592.0] | [1208.0, 1458.0] | [385, 369] |
p02549 | u860002137 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['n, k = map(int, input().split())\nMOD = 998244353\n\nlr = []\nfor _ in range(k):\n l, r = map(int, input().split())\n lr += (list(range(l, r + 1)))\n\nlr.sort()\nlr = np.array(lr)\n\ndp = np.zeros(n + n, dtype=np.int64)\ndp[0] = 1\ndp2 = dp.copy()\n\nfor i in range(n):\n idx = i + lr\n dp2[idx] += dp[i]\n... | ['Runtime Error', 'Accepted'] | ['s585987516', 's192029489'] | [18272.0, 16712.0] | [34.0, 765.0] | [345, 394] |
p02549 | u894521144 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ["mod = 998244353\n\n\ndef main(N, S):\n dp = [0 if n != 0 else 1 for n in range(N)] \n A = [0 if n != 0 else 1 for n in range(N)] \n\n for i in range(1, N): \n for l, r in S: \n if i - l < 0: \n break\n else: \n dp[i] += A[i-l]... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s329572017', 's996267709', 's963015996'] | [13416.0, 12228.0, 24652.0] | [478.0, 456.0, 425.0] | [1347, 1348, 1618] |
p02549 | u903005414 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ["from numba import jit\n\nimport sys\nsys.setrecursionlimit(10**9)\n\nN, K = map(int, input().split())\nS = set()\n\nMOD = 998244353\nfor _ in range(K):\n L, R = map(int, input().split())\n S |= set(range(L, R + 1))\n# print(f'{S=}')\n\nDP = [-1] * (N + 1)\nDP[0] = 0\nDP[1] = 1\n\n\n@njit\ndef f(idx):\n ans =... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s418195130', 's563659136', 's638989403'] | [114756.0, 131344.0, 24592.0] | [435.0, 1734.0, 1197.0] | [518, 519, 424] |
p02549 | u923270446 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['mod = 998244353\nn, k = map(int, input().split())\nlr = [list(map(int, input().split())) for i in range(k)]\ndp = [0 for i in range(n + 1)]\ndp[0] = 1\ncum = [0, 1]\ncur = [0 for i in range(k)]\nfor i in range(1, n + 1):\n cnt = 0\n for j in range(k):\n r = (i - (lr[j][1] - lr[j][0] + 1))\n l = r ... | ['Runtime Error', 'Accepted'] | ['s265789382', 's636763265'] | [141908.0, 16880.0] | [2537.0, 658.0] | [501, 405] |
p02549 | u936985471 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['import sys\nreadline=sys.stdin.readline\n\nimport numpy as np\nfrom numba import njit,i8\n\nN,K=map(int,readline().split())\nDIV = 998244353\nsteps = []\nfor i in range(K):\n l,r = map(int,readline().split())\n for j in range(l, r + 1):\n steps.append(j)\n \nsteps = sorted(steps)\nsteps = np.array(steps, dtyp... | ['Runtime Error', 'Accepted'] | ['s323945188', 's229097696'] | [108056.0, 24396.0] | [1919.0, 1032.0] | [580, 486] |
p02549 | u942051624 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['import collections\nimport math\nimport sys\nsys.setrecursionlimit(10**7)\ninf=998244353\n\n\nN,K=map(int,input().split())\nSS=[]\n\nfor i in range(K):\n s1,s2=map(int,input().split())\n for j in range(s1,s2+1):\n SS.append(j)\n\n# Driver program to test above function \n\ntable = [0 for k in range(N-1)]... | ['Wrong Answer', 'Accepted'] | ['s098398357', 's942076593'] | [25140.0, 25180.0] | [2206.0, 982.0] | [495, 503] |
p02549 | u945228737 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ["# import sys\n\n\n# from collections import deque\n# from decorator import stop_watch\n# \n# \n# @stop_watch\ndef solve(N, K, LR):\n mod = 998244353\n S = []\n for lr in LR:\n S += [i for i in range(lr[0], lr[1] + 1)]\n S.sort()\n dp = [0] * (N + 1)\n dp[1] = 1\n for i in range(1, N + 1):\... | ['Runtime Error', 'Accepted'] | ['s874144801', 's626452461'] | [9524.0, 16828.0] | [27.0, 818.0] | [777, 2056] |
p02549 | u960237860 | 2,000 | 1,048,576 | There are N cells arranged in a row, numbered 1, 2, \ldots, N from left to right. Tak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below. You are given an integer K that is less than or equal to 10, and K non- intersecting segments [L_1, R_1], [L_2, R_... | ['N, K = map(int, input().split())\nS = []\nfor i in range(K):\n L, R = map(int, input().split())\n S += list(range(L, R+1))\n\ndp = [0] * N\ndp[0] = 1\n\nS.sort()\n\nfor i in range(1, N):\n for s in S:\n if i - s < 0:break\n dp[i] = (dp[i] + dp[i - s]) % 998244353\n\nprint(dp)\n\nprint(dp[-1])',... | ['Wrong Answer', 'Accepted'] | ['s797528276', 's934468718'] | [18928.0, 24356.0] | [2206.0, 932.0] | [298, 445] |
p02550 | u056358163 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\n\nans = X\nx = X\n\nC = [0, x]\nXd = [-1] * (M+1)\nXd[x] = 0\nXl = [x]\n\nfor i in range(1, N):\n x = x**2 % M\n\n if Xd[x] > -1:\n break\n Xd[x] = i\n Xl.append(x)\n ans += x\n C.append(ans)', 'N, X, M = map(int, input().split())\n\nans = 0\nC = [0]\nXd =... | ['Wrong Answer', 'Accepted'] | ['s383852709', 's546406764'] | [15664.0, 13472.0] | [64.0, 61.0] | [235, 408] |
p02550 | u060793972 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m=map(int,input().split())\nl=[0 for i in range(m)]\nans=0\ny=[]\ni=1\nflag=0\nys=n\nwhile i<n:\n if flag==0:\n ans+=x\n l[x]+=1\n x=x*x%m\n i+=1\n if l[x]==2 and flag==0:\n flag=1\n ys=i\n if flag:\n if l[x]==3:\n break\n y.append(x)\nif len(y):\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s530979778', 's625113116', 's020307746'] | [11784.0, 11792.0, 11872.0] | [107.0, 108.0, 107.0] | [421, 420, 423] |
p02550 | u095094246 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m=map(int,input().split())\n\na_i = x\nlog = [x]\napp=[-1]*m\napp[x]=0\nlast = x\nfor i in range(1,n):\n a_i = (a_i**2)%m\n if app[a_i] > -1:\n last = a_i\n break\n app[a_i] = i\n log.append(a_i)\n\n\nans = sum(log[:min(n, app[last])])\nif n > app[last]:\n \n ans += sum(log[app[last]:]) * ((n-app[last... | ['Wrong Answer', 'Accepted'] | ['s226560544', 's467751951'] | [13636.0, 13660.0] | [70.0, 57.0] | [593, 581] |
p02550 | u133936772 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m=map(int,input().split())\nl=[-1]*m\ns=[0]*m\nt=p=0\nwhile l[x]<0:\n t+=1\n l[x]=t\n s[x]=s[p]+x\n p=x\n x=pow(p,2,m)\n print(t,x,s[p])\nT=t+1-l[x]\nprint(T)\nS=s[p]+x-s[x]\nprint(S)\nif n<l[x]:\n print(s[l.index(n)])\nelse:\n print(S*((n-l[x])//T)+s[l.index(l[x]+(n-l[x])%T)])', 'n,x,m=map(int,input().sp... | ['Wrong Answer', 'Accepted'] | ['s726054782', 's148286258'] | [14028.0, 14052.0] | [123.0, 61.0] | [272, 180] |
p02550 | u135346354 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\ndp = [False]*(M+1)\ndp[X] = True\nS = [0]*(M+1)\nS[1] = X\ntmp = X\nfor i in range(2, M+1):\n tmp = pow(tmp, 2, M)\n if dp[tmp]:\n for j in range(i):\n if tmp == S[j]:\n break\n ans = 0\n for k in range(j, i):\n ans +... | ['Wrong Answer', 'Accepted'] | ['s396719153', 's405049806'] | [11964.0, 11916.0] | [79.0, 90.0] | [571, 585] |
p02550 | u137542041 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\n\nnxt = X\nlst = []\ndic = {}\n\nfor i in range(M):\n if nxt in dic:\n loop_st = dic[nxt]\n loop_ed = i - 1\n break\n\n lst.append(nxt)\n dic[nxt] = i\n\n nxt = (nxt ** 2) % M\n\n\nv = N - loop_st\nq, r = divmod(v, loop_ed - loop_st + 1)\n\npre_sum... | ['Runtime Error', 'Accepted'] | ['s422199072', 's533174953'] | [15704.0, 15728.0] | [58.0, 63.0] | [394, 435] |
p02550 | u156815136 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ["#from statistics import median\n#import collections\n\nfrom math import gcd\nfrom itertools import combinations,permutations,accumulate, product \n#from collections import deque\nfrom collections import deque,defaultdict,Counter\nimport decimal\nimport re\nimport math\nimport bisect\nimport heapq\n#\n#\n#\n\n#\n#\n# ... | ['Runtime Error', 'Accepted'] | ['s414962845', 's163659653'] | [15616.0, 15580.0] | [63.0, 68.0] | [1852, 1817] |
p02550 | u159723084 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['# -*- coding: utf-8 -*-\n\nN,X,M=map(int,input().split())\n\nA=[0]*M\nA[0]=X\nD=[0]*M\n\ns=N\nfor i in range(1,N):\n a=A[i-1]**2%M\n if D[a] == 1:\n s=A.index(a)\n break\n else:\n A[i]=a\n D[a]=1\n\nif s==N:\n ans=sum(A[:i])\nelse:\n A=A[:i]\n \n ans=0\n l=len(A)-s\... | ['Runtime Error', 'Accepted'] | ['s266576924', 's320327037'] | [12368.0, 12152.0] | [60.0, 55.0] | [411, 415] |
p02550 | u202560873 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = [int(x) for x in input().split()]\ncopy = M\n\nk = 0\nwhile M % 2 == 0:\n k += 1\n M = M // 2\nL = M\n\norder = 1\nif L != 1:\n e = 2 % L\n while e != 1:\n order += 1\n e = (2 * e) % L\n\nA = [0] * (k + order)\nA[1] = X\nfor i in range(2, k + order):\n A[i] = (A[i - 1] * A[i - 1... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s063855579', 's313054417', 's517170041', 's552363375', 's888515710', 's319020630'] | [13508.0, 20148.0, 12800.0, 12636.0, 13428.0, 21304.0] | [78.0, 42.0, 81.0, 79.0, 87.0, 79.0] | [487, 503, 491, 494, 487, 506] |
p02550 | u207363774 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M = map(int,input().split())\n\nd = {X:0}\nl = [X]\ns = 0\n\nfor i in range(1,N):\n l+=[(l[i-1]**2)%M]\n if l[i] in d:\n dl = l[d[l[i]]+1:]\n s += sum(dl)*((N-i-1)//len(dl))\n if (N-i-1)%len(dl) != 0:\n s += sum(dl[0:(N-i-1)%len(dl)])\n break\n s += l[i]\n d[l[i]] = i\nprint(s)', 'N,X,M = map... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s425277555', 's561760447', 's892910438'] | [15760.0, 30372.0, 15628.0] | [70.0, 136.0, 70.0] | [287, 287, 287] |
p02550 | u221272125 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M = map(int,input().split())\nR = [X]\nm = min(N,M)\nfor i in range(m):\n r = R[-1]\n r = r**2%M\n if r in R:\n break\n R.append(r)\nfor i in range(len(R)):\n if r == R[i]:\n break', 'N,X,M = map(int,input().split())\nR = [X]\ndr = {}\nfor i in range(M):\n dr[i] = 0\nm = min(N,M)\n... | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s031976743', 's327220223', 's664668303', 's772495136', 's853676573'] | [9688.0, 19456.0, 9228.0, 9224.0, 19444.0] | [2206.0, 76.0, 28.0, 28.0, 95.0] | [202, 261, 382, 382, 441] |
p02550 | u288430479 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m = map(int,input().split())\nmod = m\nans = 0\nbit = [-1 for i in range(m)]\ncycle = False\nfor i in range(n):\n if i == 0 :\n a = x\n bit[a] = i\n ans += a\n else:\n a = (a**2)% mod\n if bit[a] != -1:\n cy_st = bit[a]\n cy_fi = i -1\n cyc... | ['Runtime Error', 'Accepted'] | ['s408257469', 's451912986'] | [11204.0, 11396.0] | [67.0, 69.0] | [730, 1071] |
p02550 | u326609687 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['import numpy as np\ni8 = np.int64\n\n\ndef solve(N, X, M):\n memo_val = np.zeros(M, i8)\n memo_i = np.zeros(M, i8)\n ret = 0\n a = X\n for i in range(1, N):\n ret += a\n if memo_i[a] > 0:\n u = (N - memo_i[a]) // (i - memo_i[a])\n v = (N - memo_i[a]) % (i - memo_i[a]... | ['Wrong Answer', 'Accepted'] | ['s505742282', 's484207910'] | [27812.0, 28260.0] | [165.0, 163.0] | [680, 745] |
p02550 | u335406314 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M=map(int,input().split())\nA = [X,]\nsetA = {A,}\nalast=X\nflag=False\nfor i in range(min(N-1,M)):\n P=alast**2%M\n if P in setA:\n flag=True\n d = A.index(P)\n C=A[d:]\n alast=P\n break\n else:\n A.append(P)\n setA.add(P)\n alast=P\nif alast==0:\n... | ['Runtime Error', 'Accepted'] | ['s614691896', 's942207037'] | [9196.0, 13196.0] | [24.0, 59.0] | [473, 468] |
p02550 | u347502437 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | [' X, M = map(int, input().split())\nNN = N\nli = []\nwhile X not in li and N != 0:\n li = li + [X]\n X = X ** 2 % M\n N -= 1\n \nif N == 0:\n print(sum(x for x in li))\n\nelif N != 0 and X in li:\n l = len(li)\n s = li.index(X)\n T = l - s\n q = (NN - s) // T\n r = (NN - s) % T\n print... | ['Runtime Error', 'Accepted'] | ['s872322016', 's109908584'] | [9000.0, 11516.0] | [30.0, 64.0] | [427, 437] |
p02550 | u348293370 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m = map(int, input().split()) \nans = 0\nx_list = []\n\nfor i in range(m):\n if i == n or x == 0:\n ans = sum(x_list)\n print(ans)\n exit()\n x_list.append(x)\n x = (x**2)%m\n \n if x_list.count(x) == 1:\n break\n\nfor i in range(len(x_list)):\n if x_list[i] == x:\n ... | ['Wrong Answer', 'Accepted'] | ['s528174457', 's349409200'] | [9616.0, 14340.0] | [2206.0, 59.0] | [587, 432] |
p02550 | u366886346 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m=map(int,input().split())\ncnt2=set()\ncnt2.add(x)\ncnt3=[x]\ncnt4=0\ncnt5=0\ncnt6=x\nfor i in range(1,m+10):\n num2=pow(cnt6,2,m)\n if num2 in cnt2:\n for j in range(len(cnt3)):\n if cnt3[j]==num2:\n cnt7=j\n break\n cnt10=len(cnt3)-cnt7\n num4... | ['Wrong Answer', 'Accepted'] | ['s003552454', 's076041530'] | [13268.0, 13264.0] | [82.0, 83.0] | [639, 650] |
p02550 | u414050834 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n,x,m=map(int,input().split())\nans=0\np=0\nl=[x]\nif x%m==0:\n print(x)\nelse:\n for i in range(1,n):\n s=(l[i-1]**2)%m\n if s==0:\n p=1\n break\n if s in l:\n break\n else:\n l.append(s)\n if p==0:\n t=sum(l[1:])\n k=n//(len(l)-1)\n j=n%(len(1)-1)\n ans=x+t*k+sum(l[1:j... | ['Runtime Error', 'Accepted'] | ['s886467679', 's785215285'] | [9644.0, 13644.0] | [2206.0, 61.0] | [343, 716] |
p02550 | u416011173 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['# -*- coding: utf-8 -*-\n\nN, X, M = list(map(int, input().split()))\n\n\n\n\ndef f(x: int, m: int) -> int:\n return x**2 % m\n\n\nA = {X}\nloop_start_index = 0\nwhile True:\n A_next = f(A[-1], M)\n if A_next in A:\n loop_start_index = A.index(A_next)\n break\n else:\n A.add(A_next)\n... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s061351612', 's715283256', 's999216555'] | [9056.0, 9240.0, 13216.0] | [28.0, 33.0, 55.0] | [639, 1258, 1261] |
p02550 | u481187938 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ["#!usr/bin/env python3\n\ndef L(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline().rstrip())\ndef SL(): return list(sys.stdin.readline().rstrip())\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\n\n\ndef main():\n N, X, M = LI()\n p = [0] * (M+10)\n p[1] = X\n ... | ['Runtime Error', 'Accepted'] | ['s425247408', 's524080567'] | [9056.0, 14508.0] | [30.0, 69.0] | [574, 3588] |
p02550 | u495667483 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['import sys, math, re\nfrom functools import lru_cache\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nMOD = 10**9+7\n\ndef input():\n return sys.stdin.readline()[:-1]\n\ndef mi():\n return map(int, input().split())\n\ndef ii():\n return int(input())\n\ndef i2(n):\n tmp = [list(mi()) for i in... | ['Wrong Answer', 'Accepted'] | ['s371075110', 's534152629'] | [17932.0, 18124.0] | [92.0, 96.0] | [980, 901] |
p02550 | u536034761 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\nflag = [False for _ in range(M)]\nrecord = list()\nrecord.append(X)\nflag[X] = 1\n\nAn = X\n\nfor i in range(M + 1):\n An = pow(An, 2, M)\n if flag[An]:\n start = flag[An]\n cnt = i + 2 - start\n cost = record[-1] - record[start - 2] if start > 1 else re... | ['Wrong Answer', 'Accepted'] | ['s955259079', 's756357432'] | [13712.0, 16464.0] | [84.0, 152.0] | [561, 703] |
p02550 | u539969758 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M = map(int,input().split())\n\nans = X\nA = X\nTF = True\nsrt = 1000000\nretu = dict()\nretu[X] = 1\nloop = X\nfor i in range(N-1):\n if TF:\n A = A**2 % M\n if retu.get(A) != None:\n srt = j\n goal = i\n TF = False\n break \n if TF:\n retu[A... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s083305804', 's652685904', 's411434845'] | [13996.0, 18020.0, 15828.0] | [57.0, 144.0, 64.0] | [544, 842, 593] |
p02550 | u543000780 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\nls = [False]*M\nls_mod = []\nx = X\nfor m in range(M+1):\n if ls[x] == False:\n ls_mod.append(x)\n ls[x] = m\n x = (x**2)%M\n else:\n last = m\n fast = ls[x]\n diff = last - fast\n break\nif last >= N:\n print(sum(ls_mod[:N]))\nelse:\n shou = (N-fast) // d... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s246428901', 's289086282', 's796667232', 's372182947'] | [9076.0, 13260.0, 13116.0, 13572.0] | [27.0, 62.0, 53.0, 58.0] | [399, 431, 419, 452] |
p02550 | u607155447 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\n\nans = 0\nchck = 0\nflag = [0]*(10**5 +1)\nlst = [X]\n\nfor i in range(N):\n X = (X**2)%M\n\n if flag[X] == 1:\n break\n\n flag[X] = 1\n lst.append(X)\n\npreindex = lst.index(X)\n\npreloop = lst[:index]\nloop = lst[index:]\n\nloopnum = (N - len(preloop))//len(l... | ['Runtime Error', 'Accepted'] | ['s312055747', 's013318311'] | [11568.0, 12172.0] | [55.0, 56.0] | [423, 421] |
p02550 | u625864724 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n, x, m = map(int,input().split())\nlst = [0 for i in range(m)]\nlst2 = [x]\ni = 2\nlst[x] = 1\nwhile True:\n if (i > n):\n break\n x = x**2%m\n if (lst[x] == 0):\n lst[x] = i\n lst2.append(lst2[i - 2] + x)\n i = i + 1\n else:\n lst2.append(lst2[i - 2] + x)\n brea... | ['Runtime Error', 'Accepted'] | ['s756473359', 's932952800'] | [13764.0, 13768.0] | [69.0, 72.0] | [468, 546] |
p02550 | u628285938 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Sep 19 22:03:19 2020\n\n@author: liang\n"""\n\nN, X, M = map(int,input().split())\nmod_set = {X}\nmod_lis = [X]\nA = [0]*(10**6+1)\nA[0] = X\nflag = False\n\nfor i in range(1,min(10**6,N)):\n tmp = A[i-1]**2%M\n if tmp in mod_set:\n flag = True\n break\... | ['Runtime Error', 'Accepted'] | ['s095125658', 's864440639'] | [21388.0, 21288.0] | [71.0, 79.0] | [842, 1645] |
p02550 | u630554891 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['import math\nn,x,m=map(int, input().split())\na = x\nans = a\nl=[a]\nflg=[0]*m\n\nfor i in range(1,m):\n tmp=(a*a)%m\n a=tmp \n ans+=tmp\n if flg[a]==1:\n lp = l.index(a)\n break\n else:\n l.append(a)\n flg[a]=1\n\nif lp != 0:\n l2 = l[lp:]\n tmp = sum(l2)\n b=math.... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s028062170', 's104363176', 's599112204'] | [12344.0, 9592.0, 12172.0] | [56.0, 2206.0, 54.0] | [438, 307, 387] |
p02550 | u642012866 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\n\nlim = 10**5+1\n\nf = [0]*(lim)\na = [0]*(lim)\n\nx = X\nf[x] = 1\na[1] = x\n\nans = x\n\ni = 1\nl = N\nwhile i < l:\n i += 1\n\n x **= 2\n x %= M\n if not x:\n break\n\n if f[x]:\n lp_len = (i-f[x])\n z = (l-i+1)//lp_len\n if z:\n ... | ['Wrong Answer', 'Accepted'] | ['s435392705', 's094838566'] | [15264.0, 16868.0] | [104.0, 98.0] | [466, 469] |
p02550 | u645487439 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n, x, m = map(int, input().split())\nans = 0\nloop_list = [0] * m\nloop_list[x] = 1\norder_list = [x]\n\nfor i in range(1, m + 1):\n x = pow(x, 2, m)\n if loop_list[x] != 1:\n loop_list[x] = 1\n order_list.append(x)\n else:\n break\n\nindex = order_list.index(x)\ntime = (n - index) // (... | ['Wrong Answer', 'Accepted'] | ['s546005706', 's578152054'] | [12164.0, 12184.0] | [78.0, 85.0] | [506, 498] |
p02550 | u684814987 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['\n\ndef main():\n n, x, m = map(int, input().split())\n l = [x]\n ltot = [x]\n\n flg = 0\n tot = x\n a = x\n for i in range(n):\n a = a ** 2 % m\n if a in set(l):\n for j in range(len(l)):\n if l[j] == a:\n l2 = l[j:]\n ... | ['Wrong Answer', 'Accepted'] | ['s893602418', 's552743853'] | [10540.0, 13496.0] | [2206.0, 53.0] | [683, 665] |
p02550 | u699522269 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M = map(int,input().split())\nrt = 0\nfor i in range(2,N+1):\n dps[i] = (dps[i-1]**2)%M\n rt+=dps[i]\nprint(rt)', 'N,X,M = map(int,input().split())\ndps = [0,X%M]+[0 for i in range(N)]\nrt = 0\nfor i in range(2,N+1):\n dps[i] = (dps[i-1]**2)%M\n rt+= dps[i]\nprint(rt)', 'n, x, m = map(int, input().split())\nm... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s128037989', 's580105984', 's678104335'] | [8944.0, 632488.0, 13616.0] | [28.0, 2227.0, 52.0] | [112, 149, 411] |
p02550 | u734876600 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n, x, m = map(int, input().split())\na = x\nmod = [a]\nloop = []\ncnt = 0\nwhile cnt < n:\n a = a**2 % m\n if a in mod:\n i = mod.index(a)\n before = mod[:i]\n loop = mod[i:]\n break\n mod.append(a)\n cnt += 1\n\nlength = len(loop)\nif length == 0:\n print(sum(mod[:n]))\nels... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s052979197', 's249515872', 's013042536'] | [9588.0, 9644.0, 12460.0] | [2205.0, 2206.0, 61.0] | [476, 441, 462] |
p02550 | u784022244 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M=map(int, input().split())\nimport time\nfrom math import log, ceil\n\n\n\nini=[0]*M\nmod=[0]*M\nini[0]=sum(list(range(1,M)))\nCounter=[0]*M\nCounter[0]=M-1\n\nfor i in range(1,M):\n now=i+1\n temp=now\n count=1\n while now**2<M:\n now=now**2\n temp+=now\n count+=1\n m=(now**2... | ['Wrong Answer', 'Accepted'] | ['s652369068', 's919493512'] | [25812.0, 12116.0] | [2206.0, 64.0] | [1156, 589] |
p02550 | u811817592 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['# -*- coding: utf-8 -*-\nN, X, M = map(int, input().split())\n\nmod_check_list = [False for _ in range(M)]\nmod_list = [(X ** 2) % M]\ncounter = 1\nmod_sum = (X ** 2) % M\nlast_mod = 0\nfor i in range(M):\n now_mod = (mod_list[-1] ** 2) % M\n if mod_check_list[now_mod]:\n last_mod = now_mod\n brea... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s172080829', 's621886069', 's831466044'] | [12436.0, 9228.0, 12172.0] | [76.0, 27.0, 62.0] | [932, 402, 402] |
p02550 | u845620905 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\nx = X\nnums = []\nisSearched = [False] * (M+1)\nisSearchedNums = [-1] * (M+1)\nn = 0\nlooped = 0\nwhile True:\n x = (x*x) % M\n if isSearched[x]:\n looped = isSearchedNums[x]\n break\n isSearched[x] = True\n isSearchedNums[x] = n\n nums.append(x)\n ... | ['Wrong Answer', 'Accepted'] | ['s694575795', 's681047736'] | [14104.0, 13972.0] | [66.0, 67.0] | [816, 812] |
p02550 | u854524560 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\nA = [X]\nA_dict = {X}\na = X\ns = X\nr = 0\nr0 = 0\nl = 0\namari = 0\n\nfor i in range(M+1):\n a = a ** 2 % M\n if a in A_dict:\n r0 = A.index(a)\n l = len(A[r0:])\n r = (N - i - 1) // l\n amari = (N - i - 1) % l\n s = sum(A[:r0]) + sum(A[r0:])*r + sum(A[r0:r0+ama... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s184454665', 's291317396', 's295898293', 's799516474', 's858204470'] | [13136.0, 13136.0, 9732.0, 9140.0, 13132.0] | [65.0, 56.0, 2206.0, 27.0, 62.0] | [368, 355, 402, 398, 358] |
p02550 | u903082918 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['\nimport sys\nimport math\nfrom functools import reduce\n\ndef readString():\n return sys.stdin.readline()\n\ndef readInteger():\n return int(readString())\n\ndef readStringSet(n):\n return sys.stdin.readline().split(" ")[:n]\n\ndef readIntegerSet(n):\n return list(map(int, readStringSet(n)))\n\ndef readI... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s449461102', 's544215917', 's787758034', 's676105789'] | [10008.0, 13408.0, 9576.0, 14592.0] | [2206.0, 52.0, 35.0, 50.0] | [983, 899, 985, 1032] |
p02550 | u913662443 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['n, x, m = map(int,input().split())\nans = x\nnum = 0\nl = [0]*min(m,10**4)\nlis = [-1]*min(m,10**4)\nl[0] = x\nlis[x] = num\nfor i in range(1,n):\n x = (x*x)%m\n num += 1\n if lis[x]!=-1:\n a = (n-i)//(i-lis[x])\n b = (n-i)%(i-lis[x])\n ans += a * sum(l[lis[x]:i])\n break\n l[i... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s056010691', 's195429644', 's558825763', 's782103849', 's412113980'] | [9232.0, 23984.0, 9248.0, 13804.0, 13936.0] | [28.0, 49.0, 27.0, 59.0, 56.0] | [396, 374, 380, 374, 390] |
p02550 | u935511247 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['#import sys\n#print(sys.maxsize)\nN,X,M=map(int,input().split())\ntable=list(range(M))\nfor i in range(M):\n table[i]=((table[i]%M)**2)%M\nprint(table[471])\nstart=X%M\nrireki=list()\nrireki.append(start)\nss=0\nfor j in range(1,N):\n if table[start] in rireki:\n ss=rireki.index(table[start])\n br... | ['Runtime Error', 'Accepted'] | ['s281803898', 's993922583'] | [13016.0, 13532.0] | [2206.0, 59.0] | [658, 688] |
p02550 | u936985471 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['import sys\nreadline=sys.stdin.readline\n\nN,X,M = map(int,readline().split())\nroute = [X]\ndic = {}\nfirst = []\nloop = []\nfor i in range(1, N):\n X = (X ** 2) % M\n if X in dic:\n first = route[:dic[X]]\n loop = route[dic[X]:]\n break\n route.append(X)\n dic[X] = i\n\nif N == len(first):\n print(sum... | ['Runtime Error', 'Accepted'] | ['s708289117', 's244176493'] | [15564.0, 23968.0] | [57.0, 1121.0] | [543, 319] |
p02550 | u973972117 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N,X,M = map(int,input().split())\nA = X%M\nAns = A\nModset = set()\nModset.add(A)\nsig = 0\nN -= 1\nfor i in range(10**7):\n A = pow(A,2,M)\n Ans += A\n if A ==0:\n break\n if A not in Modset:\n Modset.add(A)\n N -= 1\n else:\n Ans -= A\n sig = 1\n break\nprint... | ['Wrong Answer', 'Accepted'] | ['s193600108', 's664929171'] | [12508.0, 12452.0] | [899.0, 169.0] | [702, 719] |
p02550 | u995062424 | 2,000 | 1,048,576 | Let us denote by f(x, m) the remainder of the Euclidean division of x by m. Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M). Find \displaystyle{\sum_{i=1}^N A_i}. | ['N, X, M = map(int, input().split())\n\nrec = []\ns = set()\nrec.append(X)\ns.add(X)\nr = X\nidx == -1\nidx1 = -1\nfor i in range(N+1):\n r = (r**2)%M\n if(r not in s):\n rec.append(r)\n s.add(r)\n else:\n rec.append(r)\n idx = i+1\n break\n \nfor i in range(len(rec)):\n ... | ['Runtime Error', 'Accepted'] | ['s532287025', 's372759054'] | [9092.0, 13224.0] | [28.0, 60.0] | [644, 646] |
p02551 | u785573018 | 2,000 | 1,048,576 | There is a grid with N rows and N columns of squares. Let (i, j) be the square at the i-th row from the top and the j-th column from the left. Each of the central (N-2) \times (N-2) squares in the grid has a black stone on it. Each of the 2N - 1 squares on the bottom side and the right side has a white stone on it. Q... | ['n, q = map(int, input().split())\nl = [0]*n; u = [0]*n; lmin = n-2; umin = n-2; lgoal = n; ugoal = n\nfor _ in range(q):\n s, t = map(int, input().split())\n if s == 1:\n if t > ugoal+1: u[t-1] = 0\n else:\n for i in range(t, ugoal-1):u[i] = umin\n lmin = t-2; ugoal = t\n ... | ['Wrong Answer', 'Accepted'] | ['s746746435', 's607591883'] | [11964.0, 11964.0] | [423.0, 413.0] | [479, 475] |
p02552 | u005977014 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['a,b,c,d=map(int,input().split())\nif a>=0 and b>=0 and c>=0 and d>=0:\n print(b*d)\nelif a<=0 and b>=0 and c>=0 and d>=0:\n print(b*d)\nelif a<=0 and b<=0 and c>=0 and d>=0:\n print(b*c)\nelif a<=0 and b>=0 and c<=0 and d>=0:\n print(b*d)\nelif a<=0 and b<=0 and c<=0 and d>=0:\n print(a*c)\nelif a<=0 and b>=0 an... | ['Runtime Error', 'Accepted'] | ['s797411251', 's077805600'] | [9152.0, 9144.0] | [22.0, 30.0] | [387, 51] |
p02552 | u007448456 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = 0\n\nif x == 0:\n print("1")\nif x == 1:\n print("0")', 'x = int(input())\n\nif x == 0:\n print("1")\nif x == 1:\n print("0")'] | ['Wrong Answer', 'Accepted'] | ['s901056410', 's319839667'] | [9004.0, 9028.0] | [33.0, 27.0] | [58, 69] |
p02552 | u013202780 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['print("O" if input()=="1" else "1")', 'import sys\nprint(int(sys.stdin.readline())^1)'] | ['Wrong Answer', 'Accepted'] | ['s853568975', 's932311382'] | [8864.0, 9120.0] | [26.0, 27.0] | [35, 45] |
p02552 | u013617325 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ["#!/usr/bin/env python3\nimport sys\n\n\ndef solve(x: int):\n\n if x == 1:\n return print('0')\n\n elif x == 0:\n return print('1')1\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom tem... | ['Runtime Error', 'Accepted'] | ['s289489774', 's452729699'] | [8944.0, 9168.0] | [25.0, 33.0] | [567, 566] |
p02552 | u015767468 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['def big(x):\n if x==0:\n return 1\n elif x==1:\n return 0', 'x=int(input())\nif x==0:\n print 1\nelif x==1:\n print 0', 'x=int(input())\nif x==1:\n print(0)\nelif x==0:\n print(1)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s157223077', 's448382599', 's875562127'] | [9000.0, 8880.0, 8760.0] | [23.0, 26.0, 30.0] | [61, 54, 56] |
p02552 | u024340351 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['print(1-input())', 'print(1-int(input()))'] | ['Runtime Error', 'Accepted'] | ['s452177763', 's414279787'] | [9044.0, 8984.0] | [26.0, 27.0] | [16, 21] |
p02552 | u024568043 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['print(int(not int(input()))', 'print(int(not int(input())))'] | ['Runtime Error', 'Accepted'] | ['s770215384', 's279933231'] | [8876.0, 9144.0] | [23.0, 27.0] | [27, 28] |
p02552 | u038819082 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['a,b,c,d=map(int,input().split())\nprint(max(a*c,a*d,b*c,b*d))', 'x=int(input())\nif x==0:\n x=1\nelse:\n x=0\nprint(x)'] | ['Runtime Error', 'Accepted'] | ['s034933335', 's569644797'] | [9116.0, 9084.0] | [26.0, 24.0] | [60, 50] |
p02552 | u042709364 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = int(x)\n# OUTPUTS\n# Print 1 if input is equal to 0\nif x == 0:\n print(1)\n exit()\n\n# Print 0 if input is equal to 1\nif x == 1:\n print(0)\n exit()\n\n', "VAR = input('Please enter an integer: ')\nVAR = int(VAR)\n# OUTPUTS\n# Print 1 if input is equal to 0\nif VAR == 0:\n print(1)\n exit()\n... | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s153467752', 's197696732', 's383241755', 's712235786', 's671591246'] | [8948.0, 9008.0, 9152.0, 9004.0, 8968.0] | [26.0, 30.0, 30.0, 19.0, 24.0] | [159, 244, 219, 504, 171] |
p02552 | u048826171 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['n = input()\nif n == 0:\n print(1)\nelif n ==1:\n print(0)', 'n = int(input())\nprint(1^n)'] | ['Wrong Answer', 'Accepted'] | ['s378280994', 's406425012'] | [9080.0, 9080.0] | [30.0, 29.0] | [56, 27] |
p02552 | u052331051 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['if __name__ == "__main__":\n a = input()\n a = int(a)\n if a==0:\n print(0)\n if a==1:\n print(1)', 'if __name__ == "__main__":\n a = input()\n a = int(a)\n if a==0:\n print(1)\n if a==1:\n print(0)'] | ['Wrong Answer', 'Accepted'] | ['s233599272', 's138054142'] | [9152.0, 9152.0] | [31.0, 29.0] | [117, 117] |
p02552 | u055641210 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['if input(int()):\n print(0)\nelse:\n print(1)', 'if int(input()):\n print(0)\nelse:\n print(1)'] | ['Wrong Answer', 'Accepted'] | ['s543077464', 's708557276'] | [8880.0, 9100.0] | [24.0, 25.0] | [48, 48] |
p02552 | u056118261 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = int(input())\nif x==1:\n print(0)\nelse if x==0:\n print(1)', 'x = int(input())\nif x==1:\n print(0)\n \nelse:\n print(1)'] | ['Runtime Error', 'Accepted'] | ['s747561023', 's751783574'] | [9004.0, 9144.0] | [27.0, 32.0] | [61, 56] |
p02552 | u056511037 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['princt(int(input()) ^ 1)', 'print(int(input()) ^ 1)'] | ['Runtime Error', 'Accepted'] | ['s423031727', 's032543389'] | [8992.0, 9172.0] | [24.0, 27.0] | [24, 23] |
p02552 | u066120361 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = int(input())\nprint(1 if x == 0 else 1)', 'x = int(input())\nif x == 0:\n print(1)\nelif x == 1:\n print(0)'] | ['Wrong Answer', 'Accepted'] | ['s192198050', 's945256795'] | [9032.0, 9144.0] | [27.0, 28.0] | [42, 66] |
p02552 | u066455063 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = int(input())\n\nprint(1 if x == 1 else 0)', 'x = int(input())\n \nprint(1 if x == 0 else 1)', 'x = int(input())\n\nif x == 1:\n print(0)\n \nelif x == 0:\n print(1)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s609233976', 's827294419', 's973506204'] | [9016.0, 9068.0, 8952.0] | [26.0, 31.0, 29.0] | [43, 44, 66] |
p02552 | u067694718 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['print(~int(input()))', 'print(~input())', 'print(1^int(input()))'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s325331905', 's475560260', 's928398432'] | [9016.0, 9000.0, 9036.0] | [28.0, 28.0, 25.0] | [20, 15, 21] |
p02552 | u068142202 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = int(input())\nif x != 1:\n print(0)\nelse:\n print(1)', 'x = int(input())\nif x == 1:\n print(0)\nelse:\n print(1)\n '] | ['Wrong Answer', 'Accepted'] | ['s836494848', 's263907350'] | [9144.0, 9092.0] | [28.0, 25.0] | [59, 64] |
p02552 | u090046582 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['if x == 0:\n print(1)\nelse:\n print(0)', '\nif x == 0:\n print(1)\nelse:\n print(0)', '\nx=0\n\nif x == 0:\n print(1)\nelse:\n print(0)', 'n=int(input())\nif (n==1):\n print("0")\nelse:\n print("1")'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s293888176', 's627652753', 's689319347', 's842125848'] | [9008.0, 9072.0, 8928.0, 9028.0] | [25.0, 28.0, 34.0, 26.0] | [36, 37, 42, 61] |
p02552 | u102067593 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ["a=input()\nif a==1:\n print('0')\nelse:\n print('1')", "a=input()\nif a=='1':\n print('0')\nelse:\n print('1')"] | ['Wrong Answer', 'Accepted'] | ['s071421799', 's065459062'] | [8992.0, 9056.0] | [26.0, 32.0] | [50, 52] |
p02552 | u107915058 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = input()\nprint("1" if x == "0" else "1")', 'x = input()\nprint("1" if x == "0" else "0")'] | ['Wrong Answer', 'Accepted'] | ['s729765063', 's390606291'] | [9084.0, 9080.0] | [32.0, 31.0] | [43, 43] |
p02552 | u114868394 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x=int(input())\nif x=0:\n print(1)\nelse:\n print(0)', 'a,b,c,d=list(map(int,input().split()))\nif a>=0 and c>=0:\n one=b\n two=d\n\nelif a<0 and c<0:\n one=a\n two=c\n\nelif a>=0 and c<0:\n one=a\n two=d\nelse:\n one=b\n two=c\n\n\nprint(one*two)', 'x=int(input())\nif x==0:\n print(1... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s430953934', 's526087327', 's655897562'] | [9000.0, 9124.0, 9148.0] | [29.0, 24.0, 32.0] | [54, 198, 55] |
p02552 | u116763463 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x = int(input())\nif x == 0:\n\tprint(x^1)', '#include<bits/stdc++.h>\nusing namespace std;\n\n\n\nint mod = 1000000007;\n\n// #include "debug.cpp"\n\nint dp[1000010][4];\n\nint32_t main(){\n\tint n;\n\tcin >> n;\n\n\tif(n == 1){\n\t\tcout << "0\\n";\n\t\treturn 0;\n\t}\n\n\tdp[2][0] = 64;\n\tdp[2][1] = 17;\n\tdp[2][... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s658454850', 's852705130', 's734413912'] | [9144.0, 9000.0, 9144.0] | [27.0, 24.0, 30.0] | [39, 580, 27] |
p02552 | u119015607 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['a,b,c,d= map(int,input().split())\n\nif a>=0 and b>=0 and c>=0 and d>=0:\n print(b*d)\nelif a>=0 and b>=0 and c<=0 and d<=0:\n print(a*d)\nelif a>=0 and b>=0 and c<=0 and d>=0:\n print(b*d)\nelif a<=0 and b>=0 and c>=0 and d>=0:\n print(b*d)\nelif a<=0 and b<=0 and c<=0 and d>=0:\n print(a*c)\nelif a<=... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s555727750', 's639404436', 's382391348'] | [9192.0, 9200.0, 9148.0] | [23.0, 26.0, 34.0] | [586, 587, 58] |
p02552 | u120758605 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x=int(input())\nif(x==1):\n print("0")\n elif(x==0):\n \n print("1")\n else:\n pass', 'x=int(input())\nif(x==1):\n print("0")\n elif(x==0):\n print("1")\n else:\n pass', 'x=int(input())\nif(x==1):\n \n print("0")\nelif(x==0):\n \n print("1")\nelse:\n \n pass\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s522932756', 's748732573', 's580218489'] | [8840.0, 8884.0, 9044.0] | [23.0, 27.0, 25.0] | [80, 77, 85] |
p02552 | u135331079 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['print(not int(input()))', 'print(not(int(input())))', "if input() == '0':\n print(1)\nelse:\n print(0)"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s633422742', 's787723993', 's092669886'] | [9056.0, 9152.0, 8920.0] | [23.0, 28.0, 29.0] | [23, 24, 50] |
p02552 | u135642682 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['a,b,c,d = map(int, input().split())\nif a >=0:\n if c > 0:\n print(b * d)\n elif d < 0:\n print(a * d)\n else:\n print(b*d)\nelse:\n if c > 0:\n print(b * c)\n elif d < 0:\n print(a * c)\n else:\n print(b * c)', 'a,b,c,d = map(int, input().split())\nif a >=0... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s193274845', 's811770987', 's587518160'] | [9208.0, 9184.0, 9144.0] | [23.0, 28.0, 27.0] | [255, 255, 61] |
p02552 | u135832955 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ["import random\n\n\ndef gcd(a, b):\n if a == 0:\n return b\n return gcd(b % a, a)\n\n\ndef lcm(a, b):\n return (a * b) / gcd(a, b)\nx=input()\nif x==1:\n print('0')\nelse:\n print('1')", 'import random\n\n\ndef gcd(a, b):\n if a == 0:\n return b\n return gcd(b % a, a)\n\n\ndef lcm(a,... | ['Wrong Answer', 'Accepted'] | ['s338782402', 's695349339'] | [9436.0, 9488.0] | [31.0, 32.0] | [190, 404] |
p02552 | u153924627 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['if int(input()) == 1:\n print(1)\nelse:\n print(0)', 'if int(input()) == 1:\n print(0)\nelse:\n print(1)'] | ['Wrong Answer', 'Accepted'] | ['s606896632', 's292214598'] | [9156.0, 9136.0] | [29.0, 27.0] | [49, 49] |
p02552 | u161701206 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['a = input()\nprint(a)', 'a = int(input())\nif a != 0:\n print(0)\nelse:\n print(1)'] | ['Wrong Answer', 'Accepted'] | ['s126217862', 's936167151'] | [9132.0, 9088.0] | [29.0, 31.0] | [20, 59] |
p02552 | u167542063 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['x=input()\nif x==1:\n \tprint("0")\nelif x==0:\n \tprint("1")\n ', 'x=int(input())\nif x==1:\n \tprint(0)\nelif x==0:\n \tprint(1)'] | ['Wrong Answer', 'Accepted'] | ['s744088834', 's919040168'] | [8940.0, 9144.0] | [23.0, 27.0] | [62, 58] |
p02552 | u168825829 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['X = int(input())\nif X == "0":\n print("1")\nelif X == "1":\n print("0")', 'X = int(input())\nif X == 0:\n print("1")\nelif X == 1:\n print("0")'] | ['Wrong Answer', 'Accepted'] | ['s741028515', 's837502256'] | [9088.0, 9080.0] | [30.0, 31.0] | [74, 70] |
p02552 | u171356057 | 2,000 | 1,048,576 | Given is an integer x that is greater than or equal to 0, and less than or equal to 1. Output 1 if x is equal to 0, or 0 if x is equal to 1. | ['def(x)\n if x == 1\n return 0\nreturn 1', 'x = int ( input() )\nif x==1:\n print (0)\n \nelse :\n print (1)'] | ['Runtime Error', 'Accepted'] | ['s234907499', 's786938371'] | [8852.0, 9052.0] | [25.0, 29.0] | [37, 62] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.