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
|
---|---|---|---|---|---|---|---|---|---|---|
p03316 | u740767776 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['def keta(x):\n wa = 0\n while x >= 0:\n wa = int(x % 10)\n x = x // 10\n return wa\n\nn = int(input())\nif n % keta(n) == 0:\n print("Yes")\nelse:\n print("No")\n ', 'def keta(x):\n wa = 0\n while x >= 1:\n wa += int(x % 10)\n x = int(x / 10)\n return wa\n \nn = int(input())\nif n % keta(n) == 0:\n print("Yes")\nelse:\n print("No")'] | ['Time Limit Exceeded', 'Accepted'] | ['s680512480', 's571315298'] | [2940.0, 3060.0] | [2104.0, 17.0] | [165, 166] |
p03316 | u741080884 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['import sys\n\n\ndef solve(a):\n s = 0\n for b in str(a):\n s += int(b)\n if a%s==0:\n return "Yes"\n else:\n return "No"\n \n\ndef readQuestion():\n line = sys.stdin.readline().rstrip()\n return line\n\ndef main():\n n = readQuestion()\n answer = solve(n)\n print(answer)\n \nif __name__ == \'__main__\':\n main()', 'import sys\n\n\ndef solve(a):\n s = 0\n for b in str(a):\n s += int(b)\n if a%s==0:\n return "Yes"\n else:\n return "No"\n\ndef readQuestion():\n line = sys.stdin.readline().rstrip()\n return int(line)\n\ndef main():\n n = readQuestion()\n answer = solve(n)\n print(answer)\n \nif __name__ == \'__main__\':\n main()'] | ['Runtime Error', 'Accepted'] | ['s043670922', 's144725167'] | [3060.0, 3060.0] | [17.0, 17.0] | [510, 506] |
p03316 | u746300610 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['a=input()\nl=[int(i) for i in list(str(a))]\ns=0\nfor i in l:\n s+=i\nif a % s==0:\n print("Yes")\nelse:\n print("No")', 'a=int(input())\nl=[int(i) for i in list(str(a))]\ns=0\nfor i in l:\n s+=i\nif a % s==0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s540507896', 's351088151'] | [2940.0, 2940.0] | [17.0, 18.0] | [113, 118] |
p03316 | u746627216 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = list(input())\nn = 0\n\nS = 0\nfor i in range(len(N)):\n S = S + int(N[i])\n n = (int(N[i])999999999 * (10 ** (len(N) - i - 1))) + n\n \nif n % S == 0:\n print('Yes')\nelse:\n print('No')", "N = list(input())\nn = 0\n\nS = 0\nfor i in range(len(N)):\n S = S + int(N[i])\n n = (int(N[i])999999999 * (10 ** (len(N) - i - 1))) + n\n \nif n % S == 0:\n print('Yes')\nelse:\n print('No')", "N = list(input())\nn = 0\n\nS = 0\nfor i in range(len(N)):\n S = S + int(N[i])\n n = (int(N[i]) * (10 ** (len(N) - i - 1))) + n\n \nif n % S == 0:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s482345047', 's992942934', 's963361973'] | [2940.0, 2940.0, 3060.0] | [17.0, 17.0, 17.0] | [195, 195, 186] |
p03316 | u746793065 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n = int(input())\ns = sum(list(n))\n\nif n % s == 0:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\ns = sum(map(int, list(str(n)))\n\nif n % s == 0:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\ns = sum(map(int, list(str(n))))\n\nif n % s:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\ns = sum(int(list(str(n))))\n\nif n % s == 0:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\ns = sum(map(int,(list(str(n))))\n\nif n % s == 0:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\ns = list(n)\n\nif n % sum(s):\n print("Yes")\nelse:\n print("No")', 'n = int(input())\ns = list(n)\n\nif n % sum(s) == 0:\n print("Yes")\nelse:\n print("No")\n', 'n = int(input())\ns = sum(map(int, list(str(n))))\n\nif n % s == 0:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s208496835', 's318737320', 's330273562', 's445143093', 's523461717', 's696863110', 's984612727', 's911757968'] | [9140.0, 9012.0, 9108.0, 9152.0, 9004.0, 9148.0, 9144.0, 9136.0] | [30.0, 24.0, 27.0, 27.0, 24.0, 31.0, 18.0, 25.0] | [85, 99, 95, 95, 100, 79, 85, 100] |
p03316 | u754022296 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n = input()\nk = list(map(int, list(n)))\ns = sum(n)\nn = int(n)\nif n%k:\n print("No")\nelse:\n print("Yes")', 'n = input()\nk = list(map(int, list(n)))\ns = sum(k)\nn = int(n)\nif n%s:\n print("No")\nelse:\n print("Yes")\n'] | ['Runtime Error', 'Accepted'] | ['s631812739', 's543687266'] | [9088.0, 9160.0] | [24.0, 30.0] | [104, 105] |
p03316 | u757030836 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n = int(input())\n\n\nsum = 0\n\nfor i in range(len(n)):\n sum += n[i]\n \nif n % sum ==0:\n print("Yes")\nelse:\n print("No")', 'n = input()\n\n\nsum = 0\n\nfor i in range(len(n)):\n sum += int(n[i])\n \nif int(n) % sum ==0:\n print("Yes")\nelse:\n print("No")\n\n'] | ['Runtime Error', 'Accepted'] | ['s136059956', 's125931733'] | [2940.0, 2940.0] | [17.0, 17.0] | [119, 126] |
p03316 | u759412327 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = int(input())\nif N%sum(list(map(int,list(str(a)))))==0:\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\n\nif N%sum(map(int,str(N)))==0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s815045222', 's647193918'] | [2940.0, 9148.0] | [17.0, 30.0] | [94, 82] |
p03316 | u759848345 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['s = str(input())\n\n ans = 0\n\n for i in s:\n ans = ans + int(i)\n\n b = True if ans % 2 ==0 else False\n\n print(b)', 'if __name__ == "__main__":\n s = str(input())\n\n ans = 0\n\n for i in s:\n ans = ans + int(i)\n\n b = True if int(s) % ans == 0 else False\n\n print(b)', 'if __name__ == "__main__":\n s = str(input())\n\n ans = 0\n\n for i in s:\n ans = ans + int(i)\n\n b = True if ans % 2 == 0 else False\n\n print(b)', 'if __name__ == "__main__":\n s = str(input())\n\n ans = 0\n\n for i in s:\n ans = ans + int(i)\n\n b = True if ans % 2 == 0 else False\n\n print(b)', 'if __name__ == "__main__":\n s = str(input())\n\n ans = 0\n\n for i in s:\n ans = ans + int(i)\n\n b = "Yes" if int(s) % ans == 0 else "No"\n\n print(b)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s210649392', 's574976937', 's720693232', 's782702476', 's401600419'] | [3060.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 18.0, 20.0, 20.0, 17.0] | [127, 164, 159, 159, 164] |
p03316 | u760794812 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["S = input()\nl = [int(x) for x in list(str(S))]\ntotal = sum(l)\nif int(S)%total==0:\n print('YES')\nelse:\n print('NO') ", "S = input()\nl = [int(x) for x in list(str(S))]\ntotal = sum(l)\nif int(S)%total==0:\n print('YES')\nelse:\n print('NO') \n", "N = int(input())\nn = N\ns = 0\nwhile n> 0:\n s += n % 10\n n = n//10\n\nif N % s == 0:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s293136488', 's908996544', 's242696554'] | [2940.0, 2940.0, 2940.0] | [19.0, 18.0, 17.0] | [121, 122, 117] |
p03316 | u761989513 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['s = input()\nif s % sum(map(int, list(s))):\n print("No")\nelse:\n print("Yes")', 's = input()\nif int(s) % sum(map(int, list(s))):\n print("No")\nelse:\n print("Yes")\n'] | ['Runtime Error', 'Accepted'] | ['s370688877', 's126315287'] | [2940.0, 2940.0] | [17.0, 17.0] | [77, 83] |
p03316 | u763177133 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["n = input()\n\nl = [int(i) for i in n]\n\nif sum(l) % int(n) == 0:\n print('Yes')\nelse:\n print('No')", "n = input()\n \nl = [int(i) for i in n]\n \nif int(n) % sum(l) == 0:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s050005060', 's699747091'] | [9104.0, 9068.0] | [28.0, 27.0] | [97, 99] |
p03316 | u766393261 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N=int(input())\nn=list(str(N))\nn=[int(n) for i in n]\nsummer=sum(n)\nif N%summer==0:\n print("Yes")\nelse:\n print("No")', 'N=input()\nwa=0\nfor i in N:\n wa+=int(i)\nif (int(N)%wa)==0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s795200447', 's179875503'] | [3056.0, 2940.0] | [17.0, 17.0] | [116, 93] |
p03316 | u766407523 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["Nstr = input()\nSN = 0\nfor i in N:\n SN += int(i)\nif int(N) % SN == 0:\n print('Yes')\nelse:\n print('No')", "Nstr = input()\nSN = 0\nfor i in Nstr:\n SN += int(i)\nif int(Nstr) % SN == 0:\n print('Yes')\nelse:\n print('No')\n"] | ['Runtime Error', 'Accepted'] | ['s879574140', 's039725949'] | [2940.0, 2940.0] | [17.0, 17.0] | [110, 117] |
p03316 | u767995501 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n = int(raw_input())\nsum = 0\ntmp = n\n\nwhile tmp > 0:\n sum += tmp % 10\n tmp /= 10\n\nif n % sum == 0:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\nsum = 0\ntmp = n\n\nwhile tmp > 0:\n sum += tmp % 10\n tmp /= 10\n\nif n % sum == 0:\n print("Yes")\nelse:\n print("No")', 'n = int(raw_input())\nsum = 0\ntmp = n\n\nwhile tmp > 0:\n sum += tmp % 10\n tmp /= 10\n\nif n % sum == 0:\n print "Yes"\nelse:\n print "No"\n', "N = int(input())\n\ndef S(N):\n if N < 10:\n return N\n return N%10 + S(N//10)\n\nanswer = 'No' if N%S(N) else 'Yes'\nprint(answer)"] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s098764642', 's510470187', 's797755668', 's654988590'] | [2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0] | [143, 139, 142, 128] |
p03316 | u768559443 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n=int(input)\nsum=0\ncnt=n\n\nwhile cnt>0:\n sum+=cnt%10\n cnt/=10\n \nif n%sum==0:\n print("Yes")\nelse:\n print("No")', 'n=int(input())\nsum=0\ncnt=n\n\nwhile cnt>0:\n sum+=cnt%10\n cnt/=10\n \nif n%sum==0:\n print("Yes")\nelse:\n print("No")\n', 'n=int(input())\ns=sum(list(str(n)))\n\nif n%s==0:\n print("Yes")\nelse:\n print("No")', 'n=input()\nprint("No" if int(n)%sum(map(int,input())) else "Yes")', 'n=input()\nprint("No" if int(n)%sum(map(int,n)) else "Yes")\n'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s099834921', 's286281608', 's321632234', 's450264606', 's202669221'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 18.0, 17.0, 17.0] | [113, 116, 81, 64, 59] |
p03316 | u773246942 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['A = input()\n\nS = 0\nfor i in range(0,10):\n S += A[i]\n \nif int(A) % S == 0:\n print("Yes")\nelse:\n print("No") \n', 'A = input()\n\nS = 0\nfor i in A:\n S += A[i]\n \nif int(A) % S == 0:\n print("Yes")\nelse:\n print("No") \n', 'A = input()\n\nS = 0\nfor i in A:\n S = S + A[i]\n \nif int(A) % S == 0:\n print("Yes")\nelse:\n print("No") \n', 'A = input()\n\nS = 0\nfor i in range(0,10):\n S += A[i]\n \nif A % S == 0:\n print("Yes")\nelse:\n print("No") \n', 'A = input()\n\nS = 0\nfor i in A:\n S = S + A(i)\n \nif (int(A) % S) == 0:\n print("Yes")\nelse:\n print("No") \n', 'A = input()\n\nS = 0\nfor i in A:\n S = S + int(i)\n \nif (int(A) % S) == 0:\n print("Yes")\nelse:\n print("No") \n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s167436417', 's268253922', 's274467761', 's496843627', 's915263211', 's729613360'] | [2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0, 17.0, 17.0, 17.0] | [113, 103, 106, 108, 108, 110] |
p03316 | u774160580 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nif int(N) % sum([int(N[i] for i in range(len(N)))]) == 0:\n print("Yes")\nelse:\n print("No")\n', 'S = input()\nT = input()\nif S == T:\n print("Yes")\n exit()\nfor i in range(N):\n S = S[-1] + S[0 : len(S) - 1]\n if S == T:\n print("Yes")\n exit()\nprint("No")\n', 'N = input()\nif int(N) % sum([int(N[i]) for i in range(len(N))]) == 0:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s036030936', 's288951919', 's522986717'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [109, 179, 109] |
p03316 | u779728630 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = input()\nsN = 0\n\nfor i in N:\n sN += int(i)\n\nprint('Yes') if int(N) // sN == 0 else print('No')", "N = input()\nsN = 0\n\nfor i in N:\n sN += int(i)\n\nprint('Yes') if int(N) % sN == 0 else print('No')\n"] | ['Wrong Answer', 'Accepted'] | ['s039215716', 's266247461'] | [2940.0, 2940.0] | [17.0, 17.0] | [98, 98] |
p03316 | u780475861 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["n = int(input())\n\nh = sum(list(str(n)))\n\nprint('Yes' if n % h == 0 else 'No')", "n = int(input())\nh = sum(map(int, list(str(n))))\n\nprint('Yes' if n % h == 0 else 'No')"] | ['Runtime Error', 'Accepted'] | ['s953575990', 's219655220'] | [2940.0, 3188.0] | [17.0, 18.0] | [77, 86] |
p03316 | u780698286 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['def s(n):\n x = 0\n for i in range(len(n)):\n x += int(n[i])\n return x\nn = input()\nprint("Yes") if n % s(n) == 0 else print("No")\n', 'def s(n):\n x = 0\n for i in range(len(n)):\n x += int(n[i])\n return x\nn = input()\nprint("Yes" if n % s(n) == 0 else "No")', 'def s(n):\n x = 0\n for i in range(len(n)):\n x += int(n[i])\n return x\nn = input()\nprint("Yes") if int(n) % s(n) == 0 else print("No")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s757954722', 's927734403', 's183712174'] | [9152.0, 9060.0, 9140.0] | [24.0, 30.0, 29.0] | [133, 125, 138] |
p03316 | u787562674 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nmod = int(N[0] + N[1] + N[2])\n\nprint("Yes" if int(N) % mod == 0 else "No")', 'N = input()\nmod = int(N[0] + N[1] + N[2])\n\nprint("Yes" if int(N) % mod == 0 else "No")', 'N = input()\nsum = 0\n\nfor i in range(len(N)):\n sum += int(N[i])\nprint("Yes" if int(N) % sum == 0 else "No")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s775694722', 's959860069', 's121217825'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [86, 86, 110] |
p03316 | u790301364 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['def main14():\n strbuf = input(\'\');\n num = int(strbuf);\n kari = num;\n peku = 0;\n while(True):\n iti = int(kari % 10);\n peku = iti;\n if(iti<10):\n break;\n kari = (kari - iti) / 10;\n if((int(num % peku) == 0)):\n print("Yes");\n else:\n print("No");\n\ndef main15():\n strbuf1 = input(\'\');\n strbuf2 = input(\'\');\n buf1 = [];\n buf2 = []\n for i in range(2):\n\n\nif __name__ == \'__main__\':\n main14()', 'def main14():\n strbuf = input(\'\');\n num = int(strbuf);\n kari = num;\n peku = 0;\n while(True):\n iti = int(kari % 10);\n peku = peku + iti;\n if(kari<10):\n break;\n kari = (kari - iti) / 10;\n if((int(num % peku) == 0)):\n print("Yes");\n else:\n print("No");\n\ndef main15():\n strbuf1 = input(\'\');\n strbuf2 = input(\'\');\n buf1 = [];\n buf2 = [];\n for i in range(2):\n buf1.append(int(strbuf1[i]));\n for i in range(buf1[0]):\n buf2.append(int(strbuf2[i]));\n\n\nif __name__ == \'__main__\':\n main14()'] | ['Runtime Error', 'Accepted'] | ['s717746650', 's867511692'] | [3060.0, 3064.0] | [17.0, 17.0] | [474, 588] |
p03316 | u794652722 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\n\nsumN = 0\nfor i in N:\n sumN += int(i)\n\nif sumN%int(N) == 0:\n print("Yes")\nelse:\n print("No")\n', 'N = input()\n\nsumN = 0\nfor i in N:\n sumN += int(i)\n\nif int(N)%sumN == 0:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s899673374', 's811822733'] | [2940.0, 2940.0] | [17.0, 17.0] | [114, 114] |
p03316 | u798316285 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n=int(input())\nprint("No" if n%sum(map(int,str(n))) else "No")', 'n=int(input())\nprint("No" if n%sum(map(int,str(n))) else "Yes")'] | ['Wrong Answer', 'Accepted'] | ['s633949915', 's494432367'] | [2940.0, 2940.0] | [17.0, 17.0] | [62, 63] |
p03316 | u799691369 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["def divide(n):\n if len(str(n)) <= 1:\n return n\n\n out = n % 10\n print(n)\n return out + divide(n//10)\n\nn = int(input())\nsn = divide(n)\n\nprint('Yes' if int(n) % sn == 0 else 'No')\n", "n = input()\nsn = sum(map(int, n))\n\nprint('Yes' if n % sn == 0 else 'No')", "def divide(n):\n if len(str(n)) <= 1:\n return n\n\n out = n % 10\n \n return out + divide(n//10)\n\nn = int(input())\nsn = divide(n)\n\nprint('Yes' if int(n) % sn == 0 else 'No')\n"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s187443584', 's248953763', 's417975787'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [196, 72, 188] |
p03316 | u800058906 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["n=int(input())\ns=list(str(n))\na=n%(sum(s))\n\nif a==0:\n print('Yes')\nelse:\n print('No')", "n=int(input())\ns=list(str(n))\na=n%(sum(s))\n\nif a==0:\n print('Yes')\nelse:\n print('No')", "n=int(input())\ns=list(str(n))\nfor i in range(len(s)):\n s[i]=int(s[i])\nb=sum(s)\na=n%b\n\nif a==0:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s683806450', 's919170399', 's768190774'] | [9168.0, 9160.0, 9188.0] | [26.0, 27.0, 28.0] | [87, 87, 130] |
p03316 | u804085889 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['def S_n(n):\n num = []\n sum = 0\n while n != 0:\n num.append(n % 10)\n n = int(n / 10)\n for i in num:\n sum += i\n\n return sum\n\nif __name__ == "__main__" :\n num = int(input())\n wa = S_n(num)\n # print(wa)\n if(num % wa == 0): print("YES")\n else: print("NO")\n ', 'n=input()\nprint("Yes" if int(n)%sum(map(int, n))==0 else "No")'] | ['Wrong Answer', 'Accepted'] | ['s982375074', 's987642901'] | [3064.0, 2940.0] | [17.0, 17.0] | [307, 62] |
p03316 | u807772568 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['a = list(input())\nsu = 0\ns = 0\nk = 0\nfor i in a:\n s += int(i)\na.reverse()\nfor i in a:\n su += i*pow(10,k)\n k += 1\n \nif su % s == 0:\n print("Yes")\nelse:\n print("No")', 'a = list(input())\nsu = 0\ns = 0\nk = 0\nfor i in a:\n s += int(i)\na.reverse()\nfor i in a:\n su += int(i)*pow(10,k)\n k += 1\n \nif su % s == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s537886258', 's643865976'] | [3060.0, 3060.0] | [17.0, 17.0] | [169, 174] |
p03316 | u809108154 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['s=input()\nsum=0\nfor i in range(len(s)):\n sum+=int(s[i])\nif int(s)/sum==0:\n print("Yes")\nelse:\n print("No")', 's=input()\nsum=0\nfor i in range(len(s)):\n sum+=int(s[i])\nif int(s)%sum==0:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s304044188', 's915956296'] | [2940.0, 2940.0] | [17.0, 17.0] | [110, 110] |
p03316 | u814663076 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["\n# B - Digit Sums\n\nfrom sys import stdin\ninput = stdin.readline\n\nN = input()\nS = 0\nfor i in N:\n S += int(i)\n\nif int(N) % S == 0:\n print('Yes')\nelse:\n print('No')", "import bisect\nimport heapq\nimport math\nimport random\nimport sys\nfrom collections import Counter, defaultdict, deque\nfrom decimal import Decimal\nfrom functools import lru_cache, reduce\nfrom itertools import combinations, combinations_with_replacement, product, permutations\nfrom operator import add, mul, sub, itemgetter\nimport numpy as np\n\nsys.setrecursionlimit(10000)\n\ndef read_int():\n\treturn int(sys.stdin.readline().strip())\n\ndef read_int_n():\n\treturn [int(x) for x in sys.stdin.readline().strip().split()]\n\ndef read_float():\n\treturn float(sys.stdin.readline().strip())\n\ndef read_float_n():\n\treturn [float(x) for x in sys.stdin.readline().strip().split()]\n\ndef read_str():\n\treturn sys.stdin.readline().strip()\n\ndef read_str_n():\n\treturn [str(x) for x in sys.stdin.readline().strip().split()]\n\ndef error_print(*args):\n\tprint(*args, file=sys.stderr)\n\ndef mt(f):\n\timport time\n\tdef wrap(*args, **kwargs):\n\t\ts = time.time()\n\t\tret = f(*args, **kwargs)\n\t\te = time.time()\n\t\terror_print(e - s, 'sec')\n\t\treturn ret\n\treturn wrap\n\n@mt\ndef slv(N):\n\tS = 0\n\tfor i in N:\n\t\tS += int(i)\n\t\t\n\tif int(N) % S == 0:\n\t\tans = 'Yes'\n\telse:\n\t\tans = 'No'\n\t\t\n\treturn ans\n\ndef main():\n\tN = read_str()\n\tprint(slv(N))\n\nif __name__ == '__main__':\n\tmain()"] | ['Runtime Error', 'Accepted'] | ['s967628998', 's874914868'] | [2940.0, 16420.0] | [18.0, 205.0] | [200, 1224] |
p03316 | u816631826 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n=int(input())\ntot=0\nwhile(n>0):\n dig=n%10\n tot=tot+dig\n n=n/10\nif (n%tot)==0 :\n print(\'True\')\nelif (n%tot)!=0:\n print("False")', 'num = int(input())\nnum2 = num\nsum = 0\nwhile num2 > 0:\n sum += num2 % 10\n num2 /= 10\n\nif (num % sum) == 0:\n print("Yes")\nelse:\n print("No")', "a=input()\nsum=0\nfor i in a:\n sum=sum+ord(i)-48\n\na=int(a)\nif(a%sum==0):\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s055191388', 's510273392', 's446012836'] | [3060.0, 2940.0, 9112.0] | [19.0, 17.0, 26.0] | [140, 142, 112] |
p03316 | u818213347 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['nlist = list(map(int,input()))\nrev_n = reversed(nlist)\nsn = sum(nlist)\nn = 0\n\nfor i in range(len(nlist)):\n n += rev_n[i]*(10**i) \nif n%sn == 0:\n print("Yes")\nelse:\n print("No")', 'nlist = list(map(int,input()))\nrev_n = list(reversed(nlist))\nsn = sum(nlist)\nn = 0\n\nfor i in range(len(nlist)):\n n += rev_n[i]*(10**i) \nif n%sn == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s814506375', 's817484930'] | [8972.0, 9076.0] | [26.0, 31.0] | [185, 191] |
p03316 | u831752983 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['def s(n):\n\trtn=0\n while n>0:\n \trtn+=n%10\n n//10\n return rtn\nn=int(input())\nprint("Yes" if n%s(n)==0 else "No") ', "def s(n):\n rtn=0\n while n>0:\n rtn += n%10\n n//=10\n return rtn\nx=int(input())\nprint('Yes' if x%s(x)==0 else 'No')"] | ['Runtime Error', 'Accepted'] | ['s325714403', 's992821461'] | [2940.0, 2940.0] | [17.0, 17.0] | [127, 135] |
p03316 | u840958781 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n=int(input())\na=0\nfor i in range(len(a)):\n a+=str(n)[i]\nif n%a==0:\n print("Yes")\nelse:\n print("No")', 'n=int(input())\na=0\nfor i in range(len(str(n))):\n a+=int(str(n)[i])\nif n%int(a)==0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s549790589', 's779524593'] | [3060.0, 3060.0] | [19.0, 17.0] | [109, 124] |
p03316 | u846150137 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['s=input()\nprint("Yes" if int(s) % sum(list(s)) ==0 else "No")', 's=input()\nprint("Yes" if int(s) % sum(list(map(int,list(s)))) ==0 else "No")'] | ['Runtime Error', 'Accepted'] | ['s321579937', 's733929770'] | [2940.0, 2940.0] | [17.0, 17.0] | [61, 76] |
p03316 | u848647227 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['a = int(input())\nar = list(input())\nb = 0\nfor r in ar:\n b += int(r)\nif a % b == 0:\n print("Yes")\nelse:\n print("No")', 'b = input()\na = int(b)\nar = list(b)\nb = 0\nfor r in ar:\n b += int(r)\nif a % b == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s639885488', 's909304929'] | [2940.0, 3060.0] | [18.0, 17.0] | [118, 118] |
p03316 | u855380359 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["n = int(input())\ns = 0\nx = len(n)\nfor i in range(x):\n a = n[-1 * i]\n s = s+ a\n \nif n%a == 0:\n print('Yes')\nelse:\n print('No')", "N = input()\nNa = int(N)\n\ndef S(N):\n r = list(N)\n p = sum(map(int, r))\n return p\n\nif Na%(S(N)) == 0:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s922508478', 's369087491'] | [2940.0, 2940.0] | [17.0, 17.0] | [130, 137] |
p03316 | u855985627 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N=int(input())\nn=N\ni=1\ns=0\nwhile n>0:\n s+=n%10\n n=n//10\nprint(s)\nif N%s==0:\n print('Yes')\nelse:\n print('No')", "N=int(input())\nn=N\ni=1\ns=0\nwhile n>0:\n s+=n%10\n n=n//10\nif N%s==0:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s592264062', 's989299887'] | [3060.0, 2940.0] | [17.0, 17.0] | [112, 103] |
p03316 | u858670323 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n = input()\ns = 0\nfor x in str(n):\n s += int(x)\nif int(n)%s:\n print("Yes")\nelse:\n print("No")', 'n = input()\ns = 0\nfor x in str(n):\n s += int(x)\nif int(n)%s==0:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s340106499', 's480489009'] | [9156.0, 9160.0] | [28.0, 27.0] | [96, 100] |
p03316 | u859897687 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['a=input()\nb=int(a)\nc=0\nfor i in range(len(a)):\n c+=int(a[i])\nprint("YNeos"[b%c!=1::2])', 'a=input()\nb=int(a)\nc=0\nfor i in range(len(a)):\n c+=int(a[i])\nprint("YNeos"[b%c!=0::2])'] | ['Wrong Answer', 'Accepted'] | ['s596326304', 's595961308'] | [2940.0, 2940.0] | [17.0, 18.0] | [87, 87] |
p03316 | u863370423 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['num = int(input())\nnum2 = num\nsum = 0\nwhile num2 > 0:\n sum += num2 % 10\n num2 /= 10\n\nprint("Yes" if sum == num else "No")', 'n=int(input())\nn=str(n)\ns=0\nfor i in n:\n s+=int(i)\nif (int(n)%s==0):\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s997589242', 's749318954'] | [2940.0, 9032.0] | [17.0, 24.0] | [123, 111] |
p03316 | u870518235 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = int(input())\ns = list(str(N))\nS = 0\nfor i in range(len(s)):\n S += s[i]\n\nif N % S == 0:\n print("Yes")\nelse:\n print("No")', 's = str(input())\nN = int(S)\nS = sum(list(s))\nif N % S == 0:\n print("Yes")\nelse:\n print("No")', 's = str(input())\nN = int(s)\nS = sum(list(s))\nif N % S == 0:\n print("Yes")\nelse:\n print("No")\n', 'N = int(input())\ns = list(str(N))\nS = 0\nfor i in range(len(s)):\n S += int(s[i])\n\nif N % S == 0:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s311133584', 's469437123', 's495016660', 's259233011'] | [9044.0, 9128.0, 9184.0, 9140.0] | [25.0, 26.0, 23.0, 28.0] | [132, 98, 99, 138] |
p03316 | u874333466 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = int(input())\nS = 0\n\nfor i in range(len(str(N))):\n S += int(str(S)[i])\n \nif N % S == 0:\n print('Yes')\nelse:\n print('No')", "N = int(input())\nS = 0\n\nfor i in range(len(str(N))):\n S += int(str(N)[i])\n \nif N % S == 0:\n print('Yes')\nelse:\n print('No')\n\n"] | ['Runtime Error', 'Accepted'] | ['s813275764', 's655321492'] | [9164.0, 9144.0] | [24.0, 25.0] | [127, 129] |
p03316 | u875769753 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = input()\nnum = int(N)\nNls = list(N)\nsum1 = sum([int(i) for in Nls])\nif num%sum1 == 0:\n print('Yes')\nelse:\n print('No')", "N = input()\nnum = int(N)\nNls = list(N)\nsum1 = sum(Nls)\nif num%sum1 == 0:\n print('Yes')\nelse:\n print('No')", "N = input()\nnum = int(N)\nNls = list(N)\nsum1 = sum([int(i) for i in Nls])\nif num%sum1 == 0:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s877419205', 's901686009', 's555649688'] | [8996.0, 9100.0, 9084.0] | [25.0, 26.0, 27.0] | [123, 107, 125] |
p03316 | u881557500 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['s=input()\nn=int(s)\nsn=0\nfor d in s:\n sn+=int(d)\nif n%sn==0:\n Print("Yes")\nelse:\n print("No")', 's=input()\nn=int(s)\nsn=0\nfor d in s:\n sn+=int(d)\nif n%sn==0:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Accepted'] | ['s978019614', 's229184084'] | [2940.0, 2940.0] | [17.0, 17.0] | [95, 96] |
p03316 | u887207211 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nn = sum(list(map(int,N)))\nif(N%n == 0):\n print("Yes")\nelse:\n print("No")', 'N = input()\n\ndef num(n):\n return list(map(int,n))\n\nif(N%sum(num(N)) == 0):\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nif(N%sum(list(map(int,str(N)))) == 0):\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s202166094', 's518317859', 's408959752'] | [2940.0, 2940.0, 2940.0] | [18.0, 18.0, 18.0] | [86, 110, 90] |
p03316 | u896726004 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['#include <bits/stdc++.h>\nusing namespace std;\n\nint main() {\n int n, n_origin, s, keta;\n cin >> n;\n n_origin = n;\n s = 0;\n keta = 10;\n\n while (n >= 1) {\n s += n%10;\n n /= keta;\n }\n\n if (n_origin%s == 0) {\n cout << "Yes" << endl;\n }\n else {\n cout << "No" << endl;\n }\n}', "n = int(input())\nn_origin = n\n\ns = 0\nketa = 10\n\nwhile n >= 1:\n s += n%10\n n //= keta\n\nif n_origin%s==0:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s140211803', 's483905910'] | [2940.0, 2940.0] | [17.0, 17.0] | [327, 148] |
p03316 | u905582793 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = int(input())\nfor i in range(12):\nwa = 0\n if N // 10 ** i == 0:\n break\n else:\n wa += N // 10 ** i\n\nif N % wa == 0:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nwa = 0\nfor i in range(12):\n if N // 10 ** i == 0:\n break\n else:\n wa += N // 10 ** i\n\nif N % wa == 0:\n print("Yes")\nelse:\n print("No")', 'N = int(input())\nwals = list(str(N))\nwals = [int(s) for s in wals]\nwa = sum(wals)\n\nif N % wa == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s296416253', 's516094270', 's873769493'] | [2940.0, 2940.0, 2940.0] | [17.0, 18.0, 18.0] | [160, 160, 133] |
p03316 | u910341281 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['S= input().split() \n\nprint(S)\na=0\n\nsum=0\nfor i in S[0]:\n\t\n\tsum=sum+int(i)\n\n\n\nanser=int(S[0])%sum\n\n\n\n\n\n\nif anser == 0:\n\tprint("Yes")\n\nelse : print("No")', 'S= input().split() \n \n\na=0\n \nsum=0\nfor i in S[0]:\n\t\n\tsum=sum+int(i)\n \n \n \nanser=int(S[0])%sum\n \n \n \n \n \n \nif anser == 0:\n\tprint("Yes")\n \nelse : print("No")'] | ['Wrong Answer', 'Accepted'] | ['s274661781', 's859019643'] | [3060.0, 2940.0] | [17.0, 17.0] | [151, 155] |
p03316 | u918601425 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N=int(input())\nn=N\nsum=0\nwhile(N>0):\n sum+=N%10\n N=N//10\nif sum%n==0:\n print("Yes")\nelse:\n print("No")\n', 'N=int(input())\nn=N\nsum=0\nwhile(N>0):\n sum+=N%10\n N=N//10\nif n%sum==0:\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Accepted'] | ['s034848722', 's905503115'] | [2940.0, 2940.0] | [17.0, 17.0] | [107, 107] |
p03316 | u919633157 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["#copy code\n\nn=input()\nprint('Yes' if int(n)%sum(map(int,n)) else 'No')", "#copy code\n\nn=input()\nprint('Yes' if int(n)%sum(map(int,n))==0 else 'No')"] | ['Wrong Answer', 'Accepted'] | ['s969444339', 's139164199'] | [2940.0, 2940.0] | [17.0, 17.0] | [70, 73] |
p03316 | u922449550 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = input()\nS = 0\nfor n in N:\n S += int(n)\n\nif S % N:\n print('No')\nelse:\n print('Yes')", "N = input()\nS = 0\nfor n in N:\n S += int(n)\n\nif S % int(N):\n print('No')\nelse:\n print('Yes')", "N = input()\nS = 0\nfor n in N:\n S += int(n)\n\nif int(N) % S:\n print('No')\nelse:\n print('Yes')"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s671637556', 's791561338', 's681972332'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [89, 94, 94] |
p03316 | u923712635 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = input()\ns = 0\nfor i in N:\n s+=int(i)\nif(N%s == 0):\n print('Yes')\nelse:\n print('No')", "N = input()\ns = 0\nfor i in N:\n s+=int(i)\nif(int(N)%s == 0):\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s505707469', 's782693823'] | [2940.0, 2940.0] | [17.0, 18.0] | [90, 95] |
p03316 | u923794601 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nS = sum(map(int, N))\n\nif N % S == 0:\n print("Yes")\nelse:\n print("No")', 'N = input()\nS = sum(map(int, N))\n\nif int(N) % S == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s827377365', 's216928298'] | [2940.0, 2940.0] | [17.0, 17.0] | [87, 92] |
p03316 | u924308178 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['# coding: utf-8\n# Your code here!\n\ns = input()\nprint(sum(list(map(int,s))))', "# coding: utf-8\n# Your code here!\n\ns = input()\nprint('Yes' if int(s)%sum(list(map(int,s)))==0 else 'No')"] | ['Wrong Answer', 'Accepted'] | ['s584883727', 's249606737'] | [2940.0, 2940.0] | [18.0, 17.0] | [75, 104] |
p03316 | u924828749 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n = int(input())\n\ndef check(p):\n c = 0\n while p > 0:\n c += p % 10\n p //= 10\n return c\n\nif n % check(p) == 0:\n print("Yes")\nelse:\n print("No")', 'n = int(input())\n \ndef check(p):\n c = 0\n while p > 0:\n c += p % 10\n p //= 10\n return c\n \nif n % check(n) == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s515717534', 's441106625'] | [9076.0, 9128.0] | [22.0, 29.0] | [152, 154] |
p03316 | u928784113 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['# -*- coding: utf-8 -*-\nS = str(input())\nL = []\nfor i in range(len(S)):\n L.append(S[i])\nM = sum(L)\nif int(S) % M == 0:\n print("Yes")\nelse:\n print("No")', '# -*- coding: utf-8 -*-\nS = str(input())\nL = []\nfor i in range(len(S)):\n L.append(int(S[i]))\nM = sum(L)\nif int(S) % M == 0:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s931885324', 's381872395'] | [2940.0, 2940.0] | [18.0, 18.0] | [154, 159] |
p03316 | u934246119 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["n = int(input())\nnum = []\ntmp = n\nwhile 1:\n if tmp == 0:\n break\n num.append(int(tmp % 10))\n tmp //= 10\ns = sum(num)\nif n % s == 0:\n print('YES')\nelse:\n print('NO')\n", "n = int(input())\nnum = []\ntmp = n\nwhile 1:\n if tmp == 0:\n break\n num.append(int(tmp % 10))\n tmp //= 10\ns = sum(num)\nif n % s == 0:\n print('Yes')\nelse:\n print('No')\n"] | ['Wrong Answer', 'Accepted'] | ['s760709450', 's822833558'] | [2940.0, 2940.0] | [18.0, 17.0] | [186, 186] |
p03316 | u935845450 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['#include<bits/stdc++.h>\n\nusing namespace std;\nchar a[15];\nint main(){\n scanf("%s", a);\n int lsum = 0, sum = 0;\n for(int i = 0; i < strlen(a); i++){\n lsum += a[i] - \'0\';\n sum = sum * 10 + a[i] - \'0\';\n }\n if(sum % lsum == 0) printf("Yes\\n");\n else printf("No\\n");\n}\n', "s = input()\nprint(['Yes', 'No'][int(s) % sum(map(int, s)) != 0])"] | ['Runtime Error', 'Accepted'] | ['s777397833', 's625829481'] | [2940.0, 3060.0] | [17.0, 19.0] | [298, 64] |
p03316 | u936985471 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['n=input()\ns=0\nfor i in range(len(n)):\n s=s+int(n[i])\nprint(("No","Yes")[int(n)%s==0]', 'n=input()\ns=0\nfor i in range(len(n)):\n s=s+int(n[i])\nprint(("No","Yes")[int(n)%s==0])\n'] | ['Runtime Error', 'Accepted'] | ['s965840448', 's898852190'] | [2940.0, 2940.0] | [17.0, 17.0] | [85, 87] |
p03316 | u941884460 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["n = int(input())\ntotal = 0\nfor i in range(len(str(n))):\n total += str(n)[i]\nif N%total == 0:\n print('Yes')\nelse:\n print('No')", "n = int(input())\ntotal = 0\nfor i in range(len(str(n))):\n total += int(str(n)[i])\nif n%total == 0:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s932051900', 's686447003'] | [2940.0, 2940.0] | [17.0, 17.0] | [128, 133] |
p03316 | u952022797 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['# -*- coding: utf-8 -*-\nimport sys\nimport copy\nimport collections\nfrom bisect import bisect_left\nfrom bisect import bisect_right\nfrom collections import defaultdict\nfrom heapq import heappop, heappush\nimport numpy as np\nimport statistics\nfrom statistics import mean, median,variance,stdev\nimport math\n\ndef main():\n\tN = list(input())\n\t\n\tto = 0\n\tfor i in N:\n\t\tto += int(i)\n\t\n\tif N % to == 0:\n\t\tprint("Yes")\n\telse:\n\t\tprint("No")\n\t\n\t\nif __name__ == "__main__":\n\tmain()\n', '# -*- coding: utf-8 -*-\nimport sys\nimport copy\nimport collections\nfrom bisect import bisect_left\nfrom bisect import bisect_right\nfrom collections import defaultdict\nfrom heapq import heappop, heappush\nimport numpy as np\nimport statistics\nfrom statistics import mean, median,variance,stdev\nimport math\n\ndef main():\n\tN = list(input())\n\t\n\t\n\tto = 0\n\tNN = ""\n\tfor i in N:\n\t\tto += int(i)\n\t\tNN += i\n\t\n\tif int(NN) % to == 0:\n\t\tprint("Yes")\n\telse:\n\t\tprint("No")\n\t\n\t\nif __name__ == "__main__":\n\tmain()\n'] | ['Runtime Error', 'Accepted'] | ['s829440296', 's603247556'] | [13248.0, 13224.0] | [158.0, 159.0] | [465, 492] |
p03316 | u955251526 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["s_string = input()\ns_charlist = list(s_string)\ns_int = int(s_string)\ns_sum10 = sum(list(map(int, s_charlist)))\nif s_int % s_sum10 == 0:\n print('YES')\nelse:\n print('NO')", "s_string = input()\ns_charlist = list(s_string)\ns_int = int(s_string)\ns_sum10 = sum(list(map(int, s_charlist)))\nif s_int % s_sum10 == 0:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s880905548', 's215920802'] | [2940.0, 3060.0] | [18.0, 20.0] | [174, 174] |
p03316 | u960171798 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nS = 0\nfor n in N:\n S += n\nN = int(N)\nprint("Yes" if N%S == 0 else "No")\n', 'N = input()\nS = 0\nfor n in N:\n S += n\nN = int(N)\nprint("Yes" if N%S == 0 else "No")', 'n = input()\nN = int(n)\nn = list(n)\nfor i in range(len(n)):\n n[i] = int(n[i])\nsum_n = sum(n)\nif N%sum_n==0:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s158216320', 's972970956', 's493139484'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [85, 84, 149] |
p03316 | u963903527 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['s = input()\na = list(s)[0]\nb = list(s)[1]\nsn = a + b\nsn = int(sn)\ns = int(s)\n\nif s % sn == 0:\n print("YES")\nelse:\n print("NO")', 's = input()\nl = list(s)\nsn = 0\nfor x in l:\n sn += int(x)\n\nsn = int(sn)\ns = int(s)\n\nif s % sn == 0:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s366752308', 's421488441'] | [3060.0, 3060.0] | [17.0, 18.0] | [128, 134] |
p03316 | u967835038 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["a=int(input())\nn=list(str(a))\nN=map(int,n)\nan=0\nlena=len(n)\nfor i in range(lena):\n an += N[i]\nif a % an ==0:\n print('Yes')\nelse:\n print('No')\n", "n=str(input())\na=0\nfor i in n:\n a += int(i)\nif int(n)%a==0:\n print('Yes')\nelse:\n print('No')\n"] | ['Runtime Error', 'Accepted'] | ['s540703198', 's747881282'] | [3060.0, 2940.0] | [17.0, 17.0] | [151, 102] |
p03316 | u978494963 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nans = 0\nfor n in N:\n ans += int(n)\nif int(N) % ans == 0:\n print("Yes")\nelse:s\n print("No")', 'N = input()\nans = 0\nfor n in N:\n ans += int(n)\nif N % ans == 0:\n print("Yes")\nelse:s\n print("No")', 'N = input()\nans = 0\nfor n in N:\n ans += int(n)\nif int(N) % ans == 0:\n print("Yes")\nelse:\n print("No") '] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s019958865', 's066158812', 's198851618'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [105, 100, 105] |
p03316 | u980492406 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ["N = list(input())\nn = int(''.join(N))\nsn = 0\nfor i in N :\n sn += int(i)\nif sn % n == 0 :\n print('Yes')\nelse :\n print('No')", "N = list(input())\nn = int(''.join(N))\nsn = 0\nfor i in N :\n sn += int(i)\nif n % sn == 0 :\n print('Yes')\nelse :\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s950142031', 's604213787'] | [2940.0, 2940.0] | [17.0, 17.0] | [131, 131] |
p03316 | u996749146 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['\n# B - Digit Sums\n\n# B_Digit_Sums.py\n\nN = int(input())\nstr_N = str(N)\n\nS_N = 0\nfor i in range(len(str_N)):\n S_N += ( N % (10 ** (i+1)) ) // ( N // (10 ** i) )\nprint(S_N)\n', '\n# B - Digit Sums\n\n# B_Digit_Sums.py\n\nN = int(input())\nstr_N = str(N)\n\nS_N = 0\nfor i in range(str_N):\n S_N += ( N % (10 ** (i+1)) ) // ( N // (10 ** i) )\nprint(S_N)\n', "\n# B - Digit Sums\n\n# B_Digit_Sums.py\n\nN = int(input())\nstr_N = str(N)\n\nS_N = 0\nfor i in range(len(str_N)):\n S_N += ( N % (10 ** (i+1)) ) // (10 ** i)\n\nif N % S_N == 0:\n print('Yes')\nelse:\n print('No')\n"] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s259744223', 's823583971', 's184025788'] | [2940.0, 3064.0, 2940.0] | [17.0, 17.0, 17.0] | [229, 224, 266] |
p03316 | u999449420 | 2,000 | 1,048,576 | Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101) = 1 + 0 + 1 = 2. Given an integer N, determine if S(N) divides N. | ['N = input()\nn = int(N)\nwaru = 0\nfor i in N:\n waru += int(i)\n print(waru)\n\nif((n % waru) == 0):\n print("YES")\nelse:\n print("NO")', 'N = input()\nn = int(N)\nwaru = 0\nfor i in N:\n waru += int(i)\n print(waru)\n\nif((n % waru) == 0):\n print("Yes")\nelse:\n print("No")\n', 'N = input()\nn = int(N)\nwaru = 0\nfor i in N:\n waru += int(i)\n\nif((n % waru) == 0):\n print("Yes")\nelse:\n print("No")\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s213089466', 's526656990', 's263403061'] | [2940.0, 2940.0, 2940.0] | [17.0, 17.0, 17.0] | [139, 140, 124] |
p03317 | u004025573 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['import math\n\nN,K=map(int, input().split())\n\nA=list(map(int, input().split()))\n\n\nfor i in range(N):\n if A[i]==1:\n min_a=i+1\n break\n\nx = min_a-1\ny = N-min_a\n\n\nans=math.ceil(x/(K-1))+math.ceil(y/(K-1))\n\nif x>y:\n x=x-math.ceil(K/2)\n y=y-math.floor(K/2)\nelse:\n y=y-math.ceil(K/2)\n x=x-math.floor(K/2)\n \nans1=1+math.ceil(x/(K-1))+math.ceil(y/(K-1))\n\nif ans>ans1:\n print(ans1)\nelse:\n print(ans)', 'N,K=map(int, input().split())\n\nA=list(map(int, input().split()))\n\n\nfor i in range(N):\n if A[i]==1:\n min_a=i+1\n break\n\nx = min_a-1\ny = N-min_a\n\n\nansa=x//(K-1)+y//(K-1)\n\nif x%(K-1)>0:\n ansa=ansa+1\nif y%(K-1)>0:\n ansa=ansa+1\n\n\n#\n#if x==y and K%2==1:\n# if (x-kk)%(K-1)==0 and (y-kk)%(K-1)==0:\n\n\nkk1 = (K-1)//2\nkk0 = K-kk1\n\nif x>y:\n x=x-kk0\n y=y-kk1\nelse:\n x=x-kk1\n y=y-kk0\n\nansb = 1+x//(K-1)+y//(K-1)\n\nif x%(K-1)>0:\n ansb=ansb+1\nif y%(K-1)>0:\n ansb=ansb+1\n\nif ansa>ansb:\n ans=ansb\nelse:\n ans=ansa\n\nif N==K:\n ans = 1\n\nprint(ans)\n', 'import math\n\nN,K=map(int, input().split())\n\nA=list(map(int, input().split()))\n\n\n\nprint(math.ceil((N-1)/(K-1)))'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s061845933', 's676969100', 's102151763'] | [13812.0, 14008.0, 13812.0] | [46.0, 45.0, 40.0] | [425, 610, 110] |
p03317 | u007263493 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n , k = map(int,input().split())\nprint((n-1)//(k-2)+1)', 'n , k = map(int,input().split())\nprint((n-1)//k-2+1)', 'n , k = map(int,input().split())\nl = list(map(int,input().split()))\nm = l.index(min(l))\nif k <= m:\n ans = (m + 1) //k + 1 + (n -m) // k +1\nif k > m:\n o = k - m \n ans = (k - o) // k + 1', 'n , k = map(int,input().split())\nprint((n-2)//(k-1)+1)'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s056596936', 's198761376', 's524726522', 's605295107'] | [3060.0, 2940.0, 14008.0, 3060.0] | [18.0, 18.0, 43.0, 17.0] | [54, 52, 193, 54] |
p03317 | u013629972 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\nsys.setrecursionlimit(10**7)\ninf = 10 ** 20\neps = 1.0 / 10**10\nmod = 10**9+7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef S(): return input()\ndef pf(s): return print(s, flush=True)\n\nN, K = LI()\nA = LI()\n\nif N == K:\n print(1)\n exit()\nresult = 0\nN -= K\nresult += 1\nresult += N / (K-1)\nif N % (K-1) != 0:\n result = round(result) + 1\n\nprint(result)\n', '# import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\n\n# inf = 10 ** 20\n# eps = 1.0 / 10**10\n# mod = 10**9+7\n# dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\n# ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n# def LI(): return [int(x) for x in sys.stdin.readline().split()]\n# def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\n# def LF(): return [float(x) for x in sys.stdin.readline().split()]\n\n\n\n\n\n\n# N, K = LI()\n# A = LI()\n\n# if N == K:\n# print(1)\n# exit()\n# N -= K\n\n# if result % 1 != 0:\n# result //= 1\n# result += 1\n\n# print(int(result))\n\n\n\nimport math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\nsys.setrecursionlimit(10**7)\ninf = 10 ** 20\neps = 1.0 / 10**10\nmod = 10**9+7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef S(): return input()\ndef pf(s): return print(s, flush=True)\n\nN, K = LI()\nA = LI()\n\nif N == K:\n print(1)\n exit()\nresult = 0\nN -= K\nresult += 1\nresult += N / (K-1)\nif N % (K-1) != 0:\n result = int(result)\n\nprint(result)\n', 'import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\nsys.setrecursionlimit(10**7)\ninf = 10 ** 20\neps = 1.0 / 10**10\nmod = 10**9+7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef S(): return input()\ndef pf(s): return print(s, flush=True)\n\nN, K = LI()\nA = LI()\n\nif N == K:\n print(1)\n exit()\nresult = 0\nN -= K\nresult += 1\nresult += N / (K-1)\nif N % (K-1) != 0:\n result = int(result)\n\nprint(int(result))\n', '# import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\n\n# inf = 10 ** 20\n# eps = 1.0 / 10**10\n# mod = 10**9+7\n# dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\n# ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\n# def LI(): return [int(x) for x in sys.stdin.readline().split()]\n# def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\n# def LF(): return [float(x) for x in sys.stdin.readline().split()]\n\n\n\n\n\n\n# N, K = LI()\n# A = LI()\n\n# if N == K:\n# print(1)\n# exit()\n# N -= K\n\n# if result % 1 != 0:\n# result //= 1\n# result += 1\n\n# print(int(result))\n\n\n\nimport math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools\nsys.setrecursionlimit(10**7)\ninf = 10 ** 20\neps = 1.0 / 10**10\nmod = 10**9+7\ndd = [(-1, 0), (0, 1), (1, 0), (0, -1)]\nddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]\ndef LI(): return [int(x) for x in sys.stdin.readline().split()]\ndef LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]\ndef LF(): return [float(x) for x in sys.stdin.readline().split()]\ndef LS(): return sys.stdin.readline().split()\ndef I(): return int(sys.stdin.readline())\ndef F(): return float(sys.stdin.readline())\ndef S(): return input()\ndef pf(s): return print(s, flush=True)\n\nN, K = LI()\nA = LI()\n\nif N == K:\n print(1)\n exit()\nresult = 0\nN -= K\nresult += 1\nresult += N / (K-1)\nif N % (K-1) != 0:\n result = int(result) + 1\n\nprint(int(result))'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s389422311', 's708056324', 's989368932', 's989179099'] | [16276.0, 16272.0, 16280.0, 16272.0] | [68.0, 71.0, 70.0, 68.0] | [877, 1817, 876, 1825] |
p03317 | u017624958 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\n# print(N, K, A)\n\nanswer = N / (K - 1)\n\nprint(answer)\n', 'import math\n\nN, K = list(map(int, input().split()))\nA = list(map(int, input().split()))\n# print(N, K, A)\n\nanswer = math.ceil((N - 1)/ (K - 1))\n\nprint(answer)\n'] | ['Wrong Answer', 'Accepted'] | ['s127160820', 's593186647'] | [13880.0, 13812.0] | [41.0, 40.0] | [129, 158] |
p03317 | u019578976 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N , K = map(int, input().split(" "))\nA = list(map(int, input().split(" ")))\nprint(ceil((N-1)/(K-1)))', 'import math\nN , K = map(int, input().split(" "))\nA = list(map(int, input().split(" ")))\nprint(math.ceil((N-1)/(K-1)))'] | ['Runtime Error', 'Accepted'] | ['s358832267', 's085227854'] | [13880.0, 13812.0] | [41.0, 39.0] | [100, 117] |
p03317 | u020390084 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['import sys\n\ndef solve(N: int, K: int, A: "List[int]"):\n \n cur = K\n answer = 1\n while K < N:\n cur+=K-1\n answer +=1\n print(answer)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n K = int(next(tokens)) # type: int\n A = [int(next(tokens)) for _ in range(N)] # type: "List[int]"\n solve(N, K, A)\n\nif __name__ == \'__main__\':\n main()\n', '#!/usr/bin/env python3\nimport sys\nimport math\ndef solve(N: int, K: int, A: "List[int]"):\n \n cur = K\n answer = 1 + math.ceil((N-K)/(K-1))\n print(answer)\n return\n\n\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n K = int(next(tokens)) # type: int\n A = [int(next(tokens)) for _ in range(N)] # type: "List[int]"\n solve(N, K, A)\n\nif __name__ == \'__main__\':\n main()\n'] | ['Time Limit Exceeded', 'Accepted'] | ['s168371592', 's494518943'] | [14000.0, 14452.0] | [2104.0, 53.0] | [568, 574] |
p03317 | u021548497 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n, k = map(int, input().split())\na = [int(x) for x in input().split()]\nprint((n-1)//(k-1))', 'n, k = map(int, input().split())\na = [int(x) for x in input().split()]\nminimum = 10**9\nindex = -1\nfor i in range(n):\n if minimum > a[i]:\n index = i\n minimum = a[i]\nans = 1+(i-1)//(k-1)+(n-i-1)//(k-1)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s914993106', 's011751529'] | [13880.0, 13812.0] | [44.0, 55.0] | [90, 217] |
p03317 | u026102659 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N, K = map(int, input().split(" "))\nnums = list(input().split(" "))\na = nums.index("1")\nl = (a+1) / (K-1)\nr = (N-a) / (K-1)\nprint(l + r)', 'N, K = map(int, input().split(" "))\nif (N-1) / (K-1) == int((N-1) / (K-1)):\n ans = int((N-1)/(K-1))\nelse:\n ans = int((N-1)/(K-1)) + 1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s629785385', 's343828104'] | [10612.0, 3060.0] | [27.0, 17.0] | [136, 146] |
p03317 | u026155812 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['import math\nN, K = map(int, input().split())\nA = [int(i) for i in input().split()]\nind = A.index(1)\nif (ind%(K-1) + (N-ind-1)%(K-1)+1)%(K-1) == 0:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1))-1)\nelse:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1)))', '実装無理\nimport math\nN, K = map(int, input().split())\nA = [int(i) for i in input().split()]\nind = A.index(1)\nif (ind%(K-1) + (N-ind-1)%(K-1))%(K-1) == 0:\n print(math.floor(ind/(K-1)) + math.floor((N-ind-1)/(K-1))+1)\nelse:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1)))', '実装無理\nimport math\nN, K = map(int, input().split())\nA = [int(i) for i in input().split()]\nind = A.index(1)\nif (ind%(K-1) + (N-ind-1)%(K-1)) <= K-1:\n print(math.floor(ind/(K-1)) + math.floor((N-ind-1)/(K-1))+1)\nelse:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1)))', 'import math\nN, K = map(int, input().split())\nA = [int(i) for i in input().split()]\nind = A.index(1)\nif (ind%(K-1) + (N-ind-1)%(K-1))%(K-1) == 1:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1))-1)\nelse:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1)))', 'import math\nN, K = map(int, input().split())\nA = [int(i) for i in input().split()]\nind = A.index(1)\nif K == 2:\n print(N-1)\nelse:\n if (ind%(K-1) + (N-ind-1)%(K-1)+1) <= K-1:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1))-1)\n else:\n print(math.ceil(ind/(K-1)) + math.ceil((N-ind-1)/(K-1)))', 'import math\nN, K = map(int, input().split())\nA = [int(i) for i in input().split()]\nind = A.index(1)\nprint(math.ceil((ind + (N-ind-1))/(K-1)))'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s088704997', 's198412451', 's392431027', 's883267806', 's945800553', 's092781123'] | [13812.0, 3064.0, 3064.0, 13812.0, 13812.0, 13812.0] | [44.0, 17.0, 19.0, 47.0, 44.0, 45.0] | [276, 289, 285, 274, 320, 141] |
p03317 | u026686258 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N, K = map(int, input().split())\n\nA = list(map(int, input().split()))\n\nmin_idx = A.index(min(A))\n\nleftnum = min_idx\nrightnum = N - (min_idx + 1)\nprint((leftnum + rightnum) // (K - 1))', 'N, K = map(int, input().split())\n\nA = list(map(int, input().split()))\n\nmin_idx = A.index(min(A))\n\nif K >= N:\n print(1)\nelse:\n if ((N-1)%(K-1)):\n print((N - 1)// (K - 1))\n else:\n print((N - 1) // (K - 1) + 1)', 'N, K = map(int, input().split())\n\nA = list(map(int, input().split()))\n\nmin_idx = A.index(min(A))\n\nif K >= N:\n print(1)\nelse:\n if (n-1)%(k-1):\n print((N - 1) // (K - 1) + 1)\n else:\n print((N - 1)// (K - 1))', 'N, K = map(int, input().split())\n\nA = list(map(int, input().split()))\n\nmin_idx = A.index(min(A))\n\nif K >= N:\n print(1)\nelse:\n if ((N-1)%(K-1) == 0):\n print((N - 1)// (K - 1))\n else:\n print((N - 1) // (K - 1) + 1)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s475456096', 's597757024', 's822765914', 's261926097'] | [14008.0, 13880.0, 13880.0, 13880.0] | [42.0, 43.0, 43.0, 43.0] | [183, 230, 228, 235] |
p03317 | u026788530 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ["N,K =[int(i) for i in input().split(' ')]\n\nA = [int(i) for i in input().split(' ')]\n\nans =0\nif (N-1)%(k-1) ==0:\n ans = (N-1)//(k-1)\nelse:\n ans = (N-1)//(k-1) +1\nprint(ans)\n", "N,K =[int(i) for i in input().split(' ')]\n\nA = [int(i) for i in input().split(' ')]\n\nans =0\nif (N-1)%(K-1) ==0:\n ans = (N-1)//(K-1)\nelse:\n ans = (N-1)//(K-1) +1\nprint(ans)\n"] | ['Runtime Error', 'Accepted'] | ['s593004267', 's171875894'] | [13880.0, 13880.0] | [43.0, 43.0] | [515, 515] |
p03317 | u028554976 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n,k,*_=map(int,open(0).read().split())\nprint(-~n//-~k)', 'n,k,*_=map(int,open(0).read().split())\nprint(~-n//~-k)', 'a,b=int(input())\nfor x in input().split():\n print(x)', 'n,k=map(int,open(0).split())\nprint(0--~-n//~-k)', 'n,k=int(input().split());print(0--~-n//~-k)', "print(eval('0--~-'+''.join([i if i!=' 'else'//~-'for i in input()])))"] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s286770939', 's389273532', 's458475752', 's635740156', 's972077680', 's538413246'] | [20116.0, 20004.0, 9156.0, 8952.0, 8940.0, 9092.0] | [49.0, 48.0, 26.0, 25.0, 24.0, 28.0] | [54, 54, 53, 47, 43, 69] |
p03317 | u046585946 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n,k=map(int,input().split())\na=list(map(int,input().split()))\none_p=a.index(1)\nans=0\nif n!=k:\n ans=ans+(one_p)//(k-1) if (one_p)%(k-1)==0 else ans+(one_p)//(k-1)+1\n ans=ans+(n-one_p)//(k-1) if (n-one_p)%(k-1)==0 else ans+(n-one_p)//(k-1)+1\n if (n-k)//k==0:\n ans=ans-1\nelse:\n ans=1\nprint(ans)', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\none_p=a.index(1)\nans=0\nif n!=k:\n ans=ans+(one_p)//(k-1) if (one_p)%(k-1)==0 else ans=ans+(one_p)//(k-1)+1\n ans=ans+(n-one_p)//(k-1) if (n-one_p)%(k-1)==0: else ans=ans+(n-one_p)//(k-1)+1\nelse:\n ans=1\nprint(ans)', 'n,k=map(int,input().split())\na=list(map(int,input().split()))\none_p=a.index(1)\nans=0\nif n!=k:\n ans=ans+(one_p)//(k-1) if (one_p)%(k-1)==0 else ans+(one_p)//(k-1)+1\n ans=ans+(n-one_p)//(k-1) if (n-one_p)%(k-1)==0: else ans+(n-one_p)//(k-1)+1\nelse:\n ans=1\nprint(ans)', 'n,k=map(int,input().split())\nans=1\nwhile n>ans*(k-1)+1:\n ans=ans+1\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s230896154', 's234803171', 's587252564', 's104649868'] | [13880.0, 2940.0, 2940.0, 3060.0] | [40.0, 17.0, 18.0, 27.0] | [298, 275, 267, 78] |
p03317 | u050024609 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['[N, K] = map(int, input().split())\nA = input()\ncount = 1\nwhile N != 1:\n\tN = N // K + (1 if N - N*(N // K) != 0 else 0)\n\tcount = count + 1\nprint((K**(count - 1) - 1)//(K - 1))\n', '[N, K] = map(int, input().split())\nA = list(map(int, input().split()))\nprint(-(-(N - 1) // (K - 1)))\n'] | ['Wrong Answer', 'Accepted'] | ['s210301171', 's334027871'] | [4280.0, 14004.0] | [19.0, 41.0] | [176, 101] |
p03317 | u050708958 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n, k = [int(i) for i in input().split()]\ninput()\nif n == k:\n print(1)\n exit()\nc = 1\ni = 1\nwhile c <= n:\n c += k\n i += 1\nprint(i)\n', 'n, k = [int(i) for i in input().split()]\ninput()\nif n == k:\n print(1)\n exit()\nc = 1\ni = 1\nwhile c <= n:\n c += k - 1\n i += 1\nprint(i)', 'import math\nn, k = map(int, input().split())\nprint(math.ceil((n-k) / (k - 1) + 1))\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s730709288', 's785621397', 's489055603'] | [4724.0, 4280.0, 3060.0] | [23.0, 29.0, 17.0] | [141, 144, 83] |
p03317 | u052332717 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N,K = map(int,input().split())\na_list = list(map(int,input().split()))\n\nif (N-1)%(K-1) == 0:\n print(N//(K-1))\nelse:\n print(N//(K-1)+1)', 'N,K = map(int,input().split())\na_list = list(map(int,input().split()))\n\nif (N-1)%(K-1) == 0:\n print((N-1)//(K-1))\nelse:\n print((N-1)//(K-1)+1)'] | ['Wrong Answer', 'Accepted'] | ['s872700455', 's378590140'] | [14008.0, 14008.0] | [41.0, 41.0] | [148, 156] |
p03317 | u052499405 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['import math\nn, k = [int(item) for item in input().split()]\na = [int(item) for item in input().split()]\n\nmin_place = a.index(1) + 1\nleft = math.ceil((min_place - 1) / (k-1)) \nif left != 0:\n left_lest = (k-1) - (min_place - 1) % (k-1)\nelse:\n left_lest = 0\nright = math.ceil((n - min_place - left_lest) / (k-1))\n\nprint(left + right)', 'import math\nn, k = [int(item) for item in input().split()]\na = [int(item) for item in input().split()]\n\nmin_place = a.index(1) + 1\nleft = math.ceil((min_place - 1) / (k-1)) \nleft_lest = (k-1) - (min_place - 1) % (k-1)\nright = math.ceil((n - min_place - left_lest) / (k-1))\n\nprint(left + right)', 'import math\nn, k = [int(item) for item in input().split()]\na = [int(item) for item in input().split()]\n\nmin_place = a.index(1) + 1\nleft = math.ceil((min_place - 1) / (k-1)) \nleft_lest = 0\nif left != 0 and (min_place - 1) % (k-1) != 0:\n left_lest = (k-1) - (min_place - 1) % (k-1)\n \nright = math.ceil((n - min_place - left_lest) / (k-1))\nprint(left + right)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s433977444', 's520434339', 's278865018'] | [13812.0, 13812.0, 13812.0] | [45.0, 45.0, 45.0] | [331, 293, 358] |
p03317 | u065079240 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['\nimport math\nN, K = map(int, input().split())\nA = [int(x) for x in input().split()]\nans = math.floor((N - 1) / (K - 1))\nprint(ans)\n', '\nimport math\nN, K = map(int, input().split())\nA = [int(x) for x in input().split()]\nans = math.ceil((N - 1) / (K - 1))\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s177180039', 's520451822'] | [13812.0, 13812.0] | [45.0, 43.0] | [254, 253] |
p03317 | u066620486 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N,K = list(map(int,input().split()))\nA = list(map(int,input().split()))\nprint((N-1)//(K-1))\n', 'N,K = list(map(int,input().split()))\nA = list(map(int,input().split()))\nprint((N+K-3)//(K-1))\n'] | ['Wrong Answer', 'Accepted'] | ['s543345126', 's123820549'] | [14008.0, 13880.0] | [40.0, 40.0] | [92, 94] |
p03317 | u073852194 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n,k = map(int,input().split())\nA = list(map(int,input().split()))\na = A.index(1)\nb = -(-a//(k-1))*(k-1)+1\nif n == k:\n print(1)\nelse:\n print(-(-a//(k-1))-(-(n-b-1)//(k-1)))', 'n,k = map(int,input().split())\nA = list(map(int,input().split()))\na = A.index(1)\nb = -(-a//(k-1))*(k-1)\nif n == k:\n print(1)\nelse:\n print(-(-a//(k-1))-(-(n-b-1)//(k-1)))'] | ['Wrong Answer', 'Accepted'] | ['s118800741', 's151260726'] | [13880.0, 13880.0] | [41.0, 40.0] | [177, 175] |
p03317 | u079656139 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N, K = map(int,input().split())\nprint((N-1)//(K-1))', 'N, K = map(int,input().split())\ntmp = (N-1)%(K-1)\nans = (N-1)//(K-1)\nif tmp == 0:\n print(ans)\nelse:\n print(ans + 1)'] | ['Wrong Answer', 'Accepted'] | ['s775619513', 's490561879'] | [3060.0, 3060.0] | [23.0, 17.0] | [51, 117] |
p03317 | u083960235 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['import math\nN,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint(math.ceil((N-1)/K-1))\n\n\n \n', 'import math\nN,K=map(int,input().split())\nA=list(map(int,input().split()))\nprint(math.ceil((N-1)/(K-1)))\n\n\n \n'] | ['Wrong Answer', 'Accepted'] | ['s759999426', 's440232591'] | [13812.0, 13812.0] | [40.0, 40.0] | [109, 111] |
p03317 | u095969144 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['a, b = map(int, input().split())\nc = b - 1\n\nd = a / c\n\nprint(d + 1)', 'import math\na, b = map(int, input().split())\nc = b - 1\n\nd = a / c\n\nprint(math.ceil(d)\n', 'a, b = map(int, input().split())\nc = b - 1\n\nd = a / c\n\nprint(d)', 'import math\na, b = map(int, input().split())\nd = (a-1) / (b-1)\nprint(math.ceil(d))\n'] | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s488006159', 's876679955', 's928622625', 's556555140'] | [3060.0, 2940.0, 3060.0, 2940.0] | [17.0, 18.0, 18.0, 17.0] | [67, 86, 63, 83] |
p03317 | u102461423 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N,K = map(int,input().split())\n\nanswer = (N-1)//(K-1)+2\nprint(answer)', 'import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN,K = map(int,readline().split())\n\nanswer = (N-1+K-2) // (K-1)\nprint(answer)'] | ['Wrong Answer', 'Accepted'] | ['s629459848', 's829437392'] | [3060.0, 2940.0] | [17.0, 17.0] | [69, 193] |
p03317 | u103902792 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['n,k = map(int,input().split())\nA = list(map(int,input().split()))\nimport math\nans = math.ceil(((n-1)/(k-1))\nprint(ans)', 'n,k = map(int,input().split())\nA = list(map(int,input().split()))\nimport math\nans = math.ceil(((n-1)/(k-1)))\nprint(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s390239514', 's571150202'] | [8992.0, 20544.0] | [24.0, 44.0] | [118, 121] |
p03317 | u106297876 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['nk=input().split()\nl=input().split()\n\nnk_i=[int(s) for s in nk]\nN=nk_i[0]\nK=nk_i[1]\n\nl_i=[int(s) for s in l]\n\nj=l_i.index(1)\nj\n\nif N==K:\n print(1)\nelse:\n a=1+j//(K-1)+1+(N-1-j)//(K-1)\n print(a)\n', 'nk=input().split()\nl=input().split()\n\nnk_i=[int(s) for s in nk]\nN=nk_i[0]\nK=nk_i[1]\n\nl_i=[int(s) for s in l]\n\nif N==K:\n print(1)\nelse:\n a=-(-(N-1)//(K-1))\n print(a)'] | ['Wrong Answer', 'Accepted'] | ['s836840746', 's321977675'] | [13880.0, 13880.0] | [45.0, 45.0] | [203, 173] |
p03317 | u107091170 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N,K=map(int,input().split())\nA=list(map(int,input().split()))\nans = 1\nN -= K\nwhile N<=0:\n ans += 1\n N -= K-1\nprint(ans)', 'N,K=map(int,input().split())\nA=list(map(int,input().split()))\nans = 1\nN -= K\nwhile N>0:\n ans += 1\n N -= K-1\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s451119595', 's703520667'] | [13880.0, 13880.0] | [2104.0, 46.0] | [121, 121] |
p03317 | u111202730 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N, K = map(int, input().split())\nA = list(map(int, input().split()))\n\nprint((N+K-3)/(K-1))', 'import math\n\nN, K = map(int, input().split())\ninput()\n\nprint(math.ceil((N-1)/(K-1)))'] | ['Wrong Answer', 'Accepted'] | ['s293116330', 's856622904'] | [14004.0, 4724.0] | [43.0, 18.0] | [90, 84] |
p03317 | u111508936 | 2,000 | 1,048,576 | There is a sequence of length N: A_1, A_2, ..., A_N. Initially, this sequence is a permutation of 1, 2, ..., N. On this sequence, Snuke can perform the following operation: * Choose K consecutive elements in the sequence. Then, replace the value of each chosen element with the minimum value among the chosen elements. Snuke would like to make all the elements in this sequence equal by repeating the operation above some number of times. Find the minimum number of operations required. It can be proved that, Under the constraints of this problem, this objective is always achievable. | ['N, K = map(int, input().split())\n# perm = list(map(int, input().split()))\n\n# print(N)\n\n# print(perm)\n\nif N <= 1:\n print(0)\nelif N <= K:\n print(1)\nelse:\n print(int((N - 1) / (K - 1)))\n', 'N, K = map(int, input().split())\nperm = list(map(int, input().split()))\n\n# print(N)\n\n# print(perm)\n\nif N <= 1:\n print(0)\nelif N <= K:\n print(1)\nelse:\n print(int((N - 1) / (K - 1)))\n', 'N, K = map(int, input().split())\n# perm = list(map(int, input().split()))\n\n# print(N)\n\n# print(perm)\n\nn = N\nret = 0\n\nn = n - K\nret += 1\n\nwhile n > 0:\n n = n - (K - 1)\n ret += 1\n\nprint(ret)\n\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s435119727', 's968499097', 's307584110'] | [3060.0, 14004.0, 3060.0] | [17.0, 41.0, 26.0] | [202, 200, 240] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.