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
p03808
u201234972
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['#import sys\n#input = sys.stdin.readline\nfrom itertools import accumulate\ndef main():\n N = int( input())\n A = list( map( int, input().split()))\n C = [0]*(N*2+2)\n L = [0]*(N*2+2)\n l = (N*(N+1))//2\n if sum(A)%(N*(N+1)//2) != 0:\n print("No")\n return\n t = sum(A)//(N*(N+1)//2)...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s439857587', 's912504755', 's980978005']
[20820.0, 3064.0, 14260.0]
[201.0, 18.0, 72.0]
[983, 850, 443]
p03808
u284854859
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
["n = int(input())\na = list(map(int,input().split()))\n\nb = [] \nfor i in range(1,n):\n b.append(a[i]-a[i-1])\nb.append(a[0]-a[n-1])\n\nw = n*(n+1)//2 \n\nif sum(a)%w != 0:\n print('NO')\nelse:\n res = 0\n c = sum(a)//w \n for i in range(n):\n b[i]-=c\n \n for i in range(n):\n if (-...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s329688470', 's476561962', 's533314031', 's381761017']
[15060.0, 15060.0, 15060.0, 14996.0]
[116.0, 113.0, 121.0, 174.0]
[553, 555, 555, 552]
p03808
u368796742
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['n = int(input())\na = list(map(int,input().split()))\ncum = sum(a)\nd = n*(n+1)//2\nif cum%d:\n print("NO")', 'n = int(input())\na = list(map(int,input().split()))\ncum = sum(a)\nd = n*(n+1)//2\nif cum%d:\n print("NO")\n exit()\nx = cum//d\n\na.append(a[0])\ncount = 0\nfor i in range(n):\n dif = a[i+1]-a[...
['Wrong Answer', 'Accepted']
['s483385919', 's469014545']
[20352.0, 20360.0]
[51.0, 91.0]
[105, 338]
p03808
u375616706
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\nA = list(map(int, input().split()))\nS = sum(A)\nlast = A[-1]\nfor i in reversed(range(1, N)):\n A[i] -= A[i-1]\nA[0] -= last\n\n\nans = "YES"\nif S % N != 0 or sum(A) != 0:\n ans = "NO"\nel...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s231788508', 's283906854', 's316816582', 's421479143', 's810349263', 's767363650']
[15012.0, 14252.0, 14652.0, 14276.0, 15020.0, 15044.0]
[89.0, 78.0, 43.0, 89.0, 92.0, 72.0]
[474, 320, 523, 495, 480, 515]
p03808
u476604182
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
["N, *A = map(int, open(0).read().split())\nM = (N+1)*N//2\nS = sum(A)\nif S%M!=0:\n print('No')\n exit()\ncnt = S//M\nx = 0\nfor i in range(N):\n df = A[(i+1)%N]-A[i]\n if (cnt-df)%N!=0 or cnt<df:\n print('No')\n break\n x += (cnt-df)//N\nelse:\n if x==cnt:\n print('Yes')\n else:\n print('No')", "N,...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s070072838', 's408823590', 's017649349']
[14068.0, 14068.0, 14068.0]
[95.0, 79.0, 79.0]
[294, 230, 230]
p03808
u505830998
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['# -*- coding: utf-8 -*-\n\ndef io_generator():\n\treturn input()\n\n#+++++++++++++++++++\n\ndef main(io):\n\tret_ng=\'NO\'\n\tret_ok=\'YES\'\n\treturn ret_ng\n\t\n\tn=int(io())\n\tl= list(map(int, io().split()))\n\t\n\tv_one_act =n*(n+1)/2\n\t\n\tif sum(l)%v_one_act != 0:\n\t\treturn ret_ng\n\t\t\n\tact_num=sum(l)//v...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s041354518', 's833605371', 's198328515']
[3064.0, 3064.0, 14476.0]
[20.0, 18.0, 116.0]
[587, 628, 613]
p03808
u583826716
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
["def main():\n N = int(input())\n A = [int(a) for a in input().rstrip().split()]\n sum_A = sum(A)\n sum_N = (N + 1) * N // 2\n if sum_A % sum_N:\n print('NO')\n\n ope_num = sum_A // sum_N\n \n diffs = [r - l - ope_num for l, r in zip(A[:-1], A[1:])] + [A[0] - A[-1]]\n if all([d % N an...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s086660699', 's384354167', 's498062575', 's990764997']
[14244.0, 3192.0, 14720.0, 14716.0]
[92.0, 22.0, 89.0, 80.0]
[440, 550, 428, 450]
p03808
u638795007
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['def examA():\n N = I()\n A = LI()\n ans = "YES"\n cur = 0\n for a in A:\n if a%2==1:\n cur +=1\n if cur%2==1:\n ans = "NO"\n print(ans)\n return\n\ndef examB():\n N = I()\n A = LI()\n ans = "YES"\n sumA = sum(A)\n oneA = (1+N)*N//2\n if sumA%oneA>0:\n...
['Wrong Answer', 'Accepted']
['s212027078', 's552859166']
[15548.0, 15524.0]
[70.0, 72.0]
[1115, 1126]
p03808
u667024514
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['n=int(input())\nlis=list(map(int,input().split()))\nnum=(n*(n+1))//2\nif sum(lis)%num!=0:\n print("No")\n exit()\nli=[lis[i]-lis[i-1]-sum(lis)//num for i in range(n)]\nans=0\nfor k in range(n):\n if -li[k]%n!=0:\n print("No")\n exit()\n ans+=-li[k]//n\nif ans == sum(lis)//num:print("Yes")\nelse:print("No")\...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s340007650', 's344360697', 's569517879', 's912145302', 's721428853']
[14252.0, 3064.0, 14592.0, 14104.0, 14292.0]
[2104.0, 17.0, 64.0, 44.0, 87.0]
[304, 301, 310, 303, 321]
p03808
u667084803
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['import sys\nN=int(input())\nA=list(map(int,input().split()))\ntotal=0\nfor i in range(N):\n total+=A[i]\nif total*2/((N+1)*N)%1!=0:\n print("NO")\n sys.exit()\ntimes=int(total*2/((N+1)*N))\nif (times-A[0]+A[N-1])/N%1! or times-A[0]+A[N-1]<0=0:\n print("NO")\n sys.exit()\nB=(times-A[0]+A[N-1])/N\nfor i in range(N...
['Runtime Error', 'Accepted']
['s983075499', 's486193619']
[2940.0, 14480.0]
[17.0, 145.0]
[470, 470]
p03808
u692632484
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['N=int(input())\nA=[int(i) for i in input().split()]\nans=True\n\nif sum(A)%(int((N*(N+1))/2))!=0:\n ans=False\nk=sum(A)*2/(N*(N+1))\n\n\nd=[A[i+1]-A[i]-k for i in range(N-1)]\nd.append(A[0]-A[N-1]-k)\nfor i in range(N):\n if d[i]%N!=0:\n ans=False\nif ans:\n print("Yes")\nelse:\n ...
['Wrong Answer', 'Accepted']
['s361980638', 's532175576']
[14620.0, 14476.0]
[106.0, 112.0]
[318, 321]
p03808
u745087332
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
["# coding:utf-8\n\nimport sys\n# from collections import Counter, defaultdict\n\nINF = float('inf')\nMOD = 10 ** 9 + 7\n\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 LS(): return sys.stdin.readline().split()\ndef II(): retur...
['Wrong Answer', 'Accepted']
['s801010364', 's259132490']
[18124.0, 14252.0]
[66.0, 67.0]
[563, 156]
p03808
u761320129
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
["N = int(input())\nsrc = map(int,input().split())\nS = sum(src)\nM = N*(N+1)//2\n\nif S%M:\n print('NO')\n exit()\n\nK = S//M\nmem = [src[i] - K*i for i in range(N)]\nmem.append(mem[0])\nfor a,b in zip(mem,mem[1:]):\n if (a-b)%N:\n print('NO')\n exit()\nprint('YES')", "N = int(input())\nA = list...
['Runtime Error', 'Accepted']
['s818538729', 's594761615']
[11104.0, 14488.0]
[41.0, 99.0]
[272, 409]
p03808
u785578220
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['N = int(input())\nA = list(map(int, input().split()))\n\nK = sum(A) / sum(range(1, N+1))\nfor i in range(-1,N-1):\n D = A[i+1] - A[i] - K \n\nfor d in D:\n if not (d <= 0 and d % N == 0):\n print("NO")\n break\nelse:\n print("YES")\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nK...
['Runtime Error', 'Accepted']
['s170268636', 's441738570']
[14476.0, 14228.0]
[78.0, 111.0]
[243, 256]
p03808
u803848678
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['n = int(input())\na = list(map(int, input().split()))\nsa = sum(a)\nstone = n*(n+1)//2\nif sa % stone:\n print("No")\n exit()\na.append(a[0])\nk = sa//stone\nd = [a[i+1]-a[i] - k for i in range(n)]\nfor i in d:\n if i%n:\n print("No")\n exit()\nprint("Yes")', 'n = int(input())\na = list(map(int...
['Wrong Answer', 'Accepted']
['s457116406', 's887374288']
[14228.0, 14108.0]
[66.0, 67.0]
[266, 274]
p03808
u808427016
2,000
262,144
There are N boxes arranged in a circle. The i-th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j...
['N = int(input())\nA = [int(_) for _ in input().split()]\n\ndef solve(N, A):\n k = N * (N + 1) // 2\n s = sum(A)\n if s % k > 0:\n return False\n m = s // k\n # print(k, s, m)\n rs = []\n for i in range(N):\n p = A[i - 1]\n q = A[i]\n delta = q - p\n y = m - delt...
['Wrong Answer', 'Accepted']
['s543834985', 's995804246']
[14244.0, 14488.0]
[353.0, 64.0]
[504, 1063]
p03809
u218843509
2,000
262,144
There is a tree with N vertices, numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_i. Currently, there are A_i stones placed on vertex i. Determine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation: * Select a pair of differe...
['import sys\nsys.setrecursionlimit(10**6)\ndef input():\n\treturn sys.stdin.readline()[:-1]\n\nn = int(input())\na = list(map(int, input().split()))\nadj = [[] for _ in range(n)]\nfor _ in range(n-1):\n\ts, t = map(int, input().split())\n\tadj[s-1].append(t-1)\n\tadj[t-1].append(s-1)\npar = [-1 for _ in range(n)]\naff...
['Wrong Answer', 'Accepted']
['s028481556', 's233997325']
[98856.0, 98976.0]
[757.0, 766.0]
[1060, 1147]
p03809
u467736898
2,000
262,144
There is a tree with N vertices, numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_i. Currently, there are A_i stones placed on vertex i. Determine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation: * Select a pair of differe...
['import sys\nsys.setrecursionlimit(500000)\nN = int(input())\nA = [0] + list(map(int, input().split()))\nE = [[] for _ in range(N+1)]\nfor _ in range(N-1):\n a, b = map(int, input().split())\n E[a].append(b)\n E[b].append(a)\n\ndef dfs(v, p=0):\n a = A[v]\n b = []\n for u in E[v]:\n if u!=p:\n...
['Wrong Answer', 'Accepted']
['s777110969', 's365392362']
[124140.0, 124140.0]
[799.0, 838.0]
[632, 632]
p03809
u754022296
2,000
262,144
There is a tree with N vertices, numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_i. Currently, there are A_i stones placed on vertex i. Determine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation: * Select a pair of differe...
['import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\n\nn = int(input())\nA = list(map(int, input().split()))\nT = [[] for _ in range(n)]\nfor _ in range(n-1):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n T[a].append(b)\n T[b].append(a)\nC = [a if len(T[i]) == 1 else a*2 for i, a in enu...
['Wrong Answer', 'Accepted']
['s646996776', 's998295137']
[115624.0, 114080.0]
[556.0, 567.0]
[627, 615]
p03809
u934019430
2,000
262,144
There is a tree with N vertices, numbered 1 through N. The i-th of the N-1 edges connects vertices a_i and b_i. Currently, there are A_i stones placed on vertex i. Determine whether it is possible to remove all the stones from the vertices by repeatedly performing the following operation: * Select a pair of differe...
["#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\ndef readln(ch):\n _res = list(map(int,str(input()).split(ch)))\n return _res\n\nn = int(input())\na = readln(' ')\ne = [set([]) for i in range(0,n+1)]\nfor i in range(1,n):\n s = readln(' ')\n e[s[0]].add(s[1])\n e[s[1]].add(s[0])\nrt = 1\nnow = n\nv =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s627421225', 's993110612', 's010883707']
[44396.0, 3196.0, 44404.0]
[974.0, 22.0, 961.0]
[912, 11, 932]
p03817
u088863512
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['# -*- coding: utf-8 -*-\nimport sys\nfrom collections import deque, defaultdict\nfrom math import sqrt, factorial, gcd, ceil\n# def input(): return sys.stdin.readline()[:-1] # warning not \\n\n\n\n\n\ndef solve():\n # n, m = [int(x) for x in input().split()]\n n = int(input())\n ans = n // 11\n n %= 11\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s550320300', 's580149985', 's528154505']
[9352.0, 9452.0, 9488.0]
[30.0, 29.0, 32.0]
[637, 641, 623]
p03817
u090406054
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x=int(input())\nans=0\nfor i in range(100000000000):\n if (i+1)%2==1:\n x-=5\n ans+=1\n if x<=0:\n print(ans)\n break\n else:\n x-=6\n if x<=0:\n print(ans)\n break\n \n ', 'x=int(input())\n\ncnt=x%11\n\nans=2*(x//11)\nif cnt>=1 and cnt<=6:\n ans+=1\nelif cnt>=7 and cnt<=...
['Wrong Answer', 'Accepted']
['s355171578', 's828020232']
[2940.0, 2940.0]
[2104.0, 17.0]
[198, 121]
p03817
u118642796
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\nans = 2*(x//11)\nif 1<=x//11<=6:\n ans += 1\nelif 7<=x//11:\n ans += 2\nprint(ans)', 'x = int(input())\nans = 2*(x//11)\nif 1<=x%11<=6: \n ans += 1\nelif 7<=x%11: \n ans += 2\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s879261412', 's302334044']
[2940.0, 3064.0]
[18.0, 17.0]
[96, 97]
p03817
u202826462
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\n\nans = (x / 11) * 2\nsub = x % 11\nif sub <= 6:\n ans += 1\nelse:\n ans += 2\n\nprint(ans)', 'x = int(input())\n\nans = (x // 11) * 2\nsub = x % 11\nif sub >= 7:\n ans += 2\nelif 0 < sub <= 6:\n ans += 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s591743944', 's325601411']
[2940.0, 2940.0]
[17.0, 17.0]
[106, 120]
p03817
u205166254
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\na = (x // 11) * 2\nb = x % 11\nif b == 0:\n print(a)\nelif b <= 7:\n print(a + 1)\nelse:\n print(a + 2)\n ', 'x = int(input())\n\na = (x // 11) * 2\nb = x % 11\nif b == 0:\n print(a)\nelif b <= 6:\n print(a + 1)\nelse:\n print(a + 2)']
['Wrong Answer', 'Accepted']
['s111096002', 's735627636']
[3064.0, 3064.0]
[24.0, 21.0]
[124, 123]
p03817
u228232845
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
["import sys\n\n\ndef input(): return sys.stdin.readline().strip()\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef IR(n): return [I() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\ndef S(): return input()\ndef LS(): return...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s284328284', 's891969296', 's912621419']
[9088.0, 9160.0, 9220.0]
[28.0, 28.0, 30.0]
[563, 490, 560]
p03817
u243961437
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\ncount = 0\nq, mod = divmod(x, 11)\ncount += q*2\nif mod > 0:\n\tif(mod <= 6):\n \tcount += 1\n\telse:\n \tcount += 2\nprint(count)', 'x = int(input())\ncount = 0\nq, mod = divmod(x, 11)\ncount += q*2\nif mod > 0:\n if(mod <= 6):\n count += 1\n else:\n count += 2\nprint(coun...
['Runtime Error', 'Accepted']
['s966808566', 's622703357']
[2940.0, 3068.0]
[17.0, 22.0]
[141, 153]
p03817
u311636831
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['X = int(input())\n\nN=X/11\nP=X%11\n\nif(P>6):\n print(2*N+2)\nelse:\n print(2*N+1)', 'X = int(input())\n\nN=((X-1)//11)*2\nP=(X-1)%11\n\nif(P>5):\n print(N+2)\nelse:\n print(N+1)']
['Wrong Answer', 'Accepted']
['s419207993', 's536613649']
[2940.0, 2940.0]
[17.0, 17.0]
[81, 90]
p03817
u375616706
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['from collections import Counter\n# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN = int(input())\nNum = list(input().split())\nC = Counter(Num)\nv = len(C)\nodd = len(list(filter(lambda x: x % 2 == 1, C.values())))\neven = v - odd\nprint(odd+even//2*2)\n', 'x =...
['Wrong Answer', 'Accepted']
['s365675796', 's453822849']
[3572.0, 2940.0]
[25.0, 18.0]
[298, 127]
p03817
u471828790
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['N = int(input())\n\nX = N // 11\nM = N % 11\nprint(X, M)\nif M == 0:\n print(X * 2)\nelif M > 6:\n print(X * 2 + 2)\nelse:\n print(X * 2 + 1)\n', 'N = int(input())\n\nX = N // 11\nM = N % 11\nif M == 0:\n print(X * 2)\nelif M > 6:\n print(X * 2 + 2)\nelse:\n print(X * 2 + 1)\n']
['Wrong Answer', 'Accepted']
['s470328100', 's519366546']
[2940.0, 2940.0]
[18.0, 17.0]
[141, 129]
p03817
u536034761
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = input()\ny = x % 11\nif y > 0:\n cnt = 1\n if y > 6:\n cnt += 1\nelse:\n cnt = 0\n \nprint(x // 11 + cnt)\n', 'x = int(input())\ny = x % 11\nif y > 0:\n cnt = 1\n if y > 6:\n cnt += 1\nelse:\n cnt = 0\n \nprint((x // 11) * 2 + cnt)']
['Runtime Error', 'Accepted']
['s629683028', 's991406437']
[8972.0, 9144.0]
[25.0, 30.0]
[120, 130]
p03817
u537782349
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['a = int(input())\nprint((a + 4.5) // 5.5)\n', 'a = int(input())\nprint(int((a + 4.5) // 5.5))\n']
['Wrong Answer', 'Accepted']
['s118433167', 's641916038']
[2940.0, 2940.0]
[17.0, 17.0]
[41, 46]
p03817
u541568482
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['import sys\n\ncin = sys.stdin\ncin = open("in.txt", "r")\n\nx = int(cin.readline())\nc = x//11\ncnt = c*2\nr = x%11\n# print(r)\nif r>0:\n cnt +=1\n if r>6:\n cnt +=1\n\nprint(cnt)\n', 'import sys\n\ncin = sys.stdin\n\nx = int(cin.readline())\nc = x//11\ncnt = c*2\nr = x%11\n# print(r)\nif r>0:\n cnt ...
['Runtime Error', 'Accepted']
['s706271657', 's393926503']
[3064.0, 3064.0]
[23.0, 22.0]
[179, 153]
p03817
u569272329
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['N=int(input())\nif N%11==0:\n print(2*N//11)\nelif N%11>6:\n print(N*2//11+2)\nelse:\n print(2*N//11+1)\n', 'N=int(input())\nif N%11==0:\n print(N//11)\nelif N%11>6:\n print(N*2//11+2)\nelse:\n print(2*N//11+1)\n', 'x = int(input())\nif x % 11 > 6:\n print(2*x//11+2)\nelse:\n print(2*x//11+1)\n', 'x = int...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s216656368', 's332884274', 's458685034', 's366708310']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 17.0]
[101, 99, 80, 115]
p03817
u578501242
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x=int(input())\nans=0\nchk=0\nans=ans+(x//11)*2\nchk=x%11\nif chk>6:\n\tans=ans+2\nif chk>0:\n\tans=ans+1\nprint(ans)', 'x=int(input())\nans=0\nchk=0\nans=ans+(x//11)*2\nchk=x%11\nif chk>6:\n\tans=ans+2\nelif chk>0:\n\tans=ans+1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s171791301', 's369546650']
[3060.0, 3064.0]
[17.0, 17.0]
[106, 108]
p03817
u580697892
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['# coding: utf-8\nfrom math import ceil, floor\nX = int(input())\nif X >= 6:\n print(1)\nelse:\n print(ceil(X / 11 * 2))', '# coding: utf-8\nfrom math import ceil\nX = int(input())\nif X <= 6:\n print(1)\nelse:\n mod = X % 11\n if mod >= 7:\n print(X // 11 * 2 + 2)\n elif mod == 0:\n pr...
['Wrong Answer', 'Accepted']
['s069622888', 's589508765']
[3064.0, 3064.0]
[17.0, 17.0]
[119, 236]
p03817
u597455618
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['def main():\n x = int(input())\n s = 0\n f = 0\n while ans < x:\n s += 1\n tmp = 6*s + 5*f\n if tmp >= x:\n print(s+f)\n exit()\n f += 1\n tmp += 5\n if tmp >= x:\n print(s+f)\n exit()\n\nif __name__ == "__main__":\n ...
['Runtime Error', 'Accepted']
['s366013524', 's921725239']
[9196.0, 9152.0]
[30.0, 30.0]
[307, 214]
p03817
u597622207
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['\n\nx = int(input())\ncount = 0\nif x == 1:\n print(count)\n exit()\nelse:\n x -= 1\n count += 1\n\ncount += (x // 11) * 2\nx = x % 11\n\n# if x == 1 or x == 8 or x == 9:\n# count += 2\n# elif x == 7 or x == 10:\n# count += 3\n# elif x == 0:\n# print(count)\n# exit()\n# else:\n# count ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s170194150', 's474846529', 's677940566', 's495465264']
[3060.0, 3064.0, 3060.0, 3060.0]
[18.0, 18.0, 18.0, 17.0]
[388, 378, 297, 207]
p03817
u625963200
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x=int(input())\n\nans=((x-1)//11)*2\nif (x-1)%11>6:\n print(ans+2)\nelse:\n print(ans+1)', 'x=int(input())\n\nans=(x//11)*2\nif x%11>6:\n print(ans+2)\nelif x%11==0:\n print(ans)\nelse:\n print(ans+1)']
['Wrong Answer', 'Accepted']
['s597141156', 's988365830']
[2940.0, 2940.0]
[17.0, 20.0]
[84, 103]
p03817
u629350026
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x=int(input())\nt=x//11\nif x-t==0:\n print(t*2)\nelif x-t<=6:\n print(t*2+1)\nelse:\n print(t*2+1)', 'x=int(input())\nt=x//11\nif x-t*11==0:\n print(t*2)\nelif x-t*11<=6:\n print(t*2+1)\nelse:\n print(t*2+2)']
['Wrong Answer', 'Accepted']
['s868545973', 's303953992']
[9168.0, 9108.0]
[26.0, 27.0]
[95, 101]
p03817
u637824361
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['N = int(input())\nif N % 11 > 6:\n print(N+10//11*2)\nelif n % 11 == 0:\n print(N//11*2)\nelse:\n print(N//11*2+1)', 'N = int(input())\nif N % 11 > 6:\n print((N+10)//11*2)\nelif N % 11 == 0:\n print(N//11*2)\nelse:\n print(N//11*2+1)']
['Runtime Error', 'Accepted']
['s861704875', 's993690985']
[2940.0, 2940.0]
[17.0, 18.0]
[111, 113]
p03817
u652737716
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['target_score = int(input())\n\ncnt = target_score // 11 * 2\ntarget_score = target_score % 11\n\nif cnt == 0:\n print(cnt)\nelif 1 <= cnt <= 6:\n print(cnt + 1)\nelse:\n print(cnt + 2)\n', 'target_score = int(input())\n\ncnt = target_score // 11 * 2\ntarget_score = target_score % 11\n\n\nif target_score == 0...
['Wrong Answer', 'Accepted']
['s770778428', 's275577074']
[3064.0, 3064.0]
[22.0, 26.0]
[184, 198]
p03817
u667024514
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['n = int(input())\nlis = list(map(int,input().split()))\nans = set()\nfor num in lis:ans.add(num)\nprint(len(ans)-((len(ans) % 2)+1)%2)', 'import math\nn = int(input())\nprint(2 * (n // 11) + math.ceil((n % 11) / 6))']
['Runtime Error', 'Accepted']
['s391862147', 's668469960']
[2940.0, 2940.0]
[16.0, 18.0]
[130, 75]
p03817
u667469290
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
["# -*- coding: utf-8 -*-\nfrom math import ceil\n\ndef solve():\n x = int(input())\n res = 2*(x//11) + (x%11!=0)\n return str(res)\n\nif __name__ == '__main__':\n print(solve())\n", "# -*- coding: utf-8 -*-\nfrom math import ceil\n\ndef solve():\n x = int(input())\n res = 2*ceil(x/11) - (0 < x%11 <= ...
['Wrong Answer', 'Accepted']
['s166948525', 's003860818']
[2940.0, 2940.0]
[17.0, 17.0]
[180, 189]
p03817
u737451238
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\n \nif x % 11 == 0:\n ans = x // 11 * 2\nelse:\n if x / 11 < 1:\n if x // 6 > 1:\n ans = 2\n else:\n ans = 1\n else:\n ans = x // 11 * 2 + 1\n \nprint(ans)', 'if x / 11 < 1:\n ans = 1\n if x / 5 >= 1:\n ans = 2\nelse:\n ans = x // 11...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s092046465', 's988071853', 's266346027']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[211, 105, 122]
p03817
u737840172
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\nquot = x//11\nif x >= 11:\n quot *= 2\nif x%11 > 0:\n quot += 1\nprint(quot)\n', 'x = int(input())\nquot = x//11\nif x >= 11:\n quot *= 2\nremainder = x%11\nif remainder > 6:\n quot += 2\nelse:\n if remainder != 0:\n quot += 1\nprint(quot)\n']
['Wrong Answer', 'Accepted']
['s704819591', 's905655412']
[3064.0, 3064.0]
[21.0, 23.0]
[95, 164]
p03817
u767664985
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\n\nif x%11 <= 6:\n print((x//11)*2 + 1)\nelse:\n print((x//11)*2 * 2)\n', 'x = int(input())\nif x%11 == 0:\n print((x//11)*2)\nelif x%11 <= 6:\n print((x//11)*2 + 1)\nelse:\n print((x//11)*2 + 2)\n']
['Wrong Answer', 'Accepted']
['s037362842', 's322511041']
[2940.0, 2940.0]
[18.0, 17.0]
[88, 124]
p03817
u768896740
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\n\nnum = x // 11\n\nx %= 11\nif x == 0:\n print(num * 2)\nelse:\n print(num * 2 + 1)', 'x = int(input())\n\nnum = x // 11\n\nx %= 11\nif x == 0:\n print(num * 2)\nelif x <= 6:\n print(num * 2 + 1)\nelse:\n print(num * 2 + 2)']
['Wrong Answer', 'Accepted']
['s216978590', 's782158616']
[2940.0, 3060.0]
[17.0, 17.0]
[99, 135]
p03817
u802234211
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['import math \nx = int(input())\nxi = math.floor(x/5.5)\nprint(xi)\nfor i in range(xi,100000000000000):\n # print(6*i - math.floor(i/2))\n if(x < 6*i-math.floor(i/2)):\n xa = i\n break\n\nprint(xa)\n', 'import math \nx = int(input())\nxi = math.floor(x/5.5)\nprint(xi)\nfor i in range(xi,10000000000...
['Runtime Error', 'Runtime Error', 'Accepted']
['s674708820', 's951048561', 's008010247']
[9096.0, 9080.0, 9048.0]
[28.0, 29.0, 31.0]
[207, 205, 237]
p03817
u806999568
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = input()\nprint((x // 11) * 2 + (2 if x % 11 > 6 else 1))\n', 'x = int(input())\nans = (x // 11) * 2\nif x % 11:\n if x % 11 > 6:\n ans += 2\n else:\n ans += 1\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s232589342', 's671876466']
[2940.0, 2940.0]
[17.0, 17.0]
[60, 122]
p03817
u835482198
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\n\ntmp = (x // 7)\nrem = x - tmp * 7\nif rem == 0:\n print(tmp)\nelse:\n print(tmp + 1)\n', '#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\nimport math\n\n\nx = int(input())\ntmp = int(math.ceil(x / 11.0 * 2.0))\n# print(11 * tmp // 2)\n# print(tmp)\nif (11 * tmp) // 2 - 5 >= x:\n print(tm...
['Wrong Answer', 'Accepted']
['s112106651', 's188982438']
[2940.0, 3064.0]
[17.0, 22.0]
[104, 217]
p03817
u859897687
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x=int(input())\nans=0\nans+=x//11*2\nx%=11\nif x>4:\n x-=5\n ans+=1\nprint(ans)', 'x=int(input())\nans=x//11*2\nx%=11\nif x<7:\n x-=6\n ans+=1\nprint(ans)', 'x=int(input())\nans=0\nans+=x//11*2\nx%=11\nif x>5:\n x-=6\n ans+=1\nprint(ans)', 'x=int(input())\nans=x//11*2\nx%=11\nif x>0 and x<7:\n ans+=1\nif x>6:\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s172792903', 's559034353', 's839700925', 's949260943']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 18.0]
[74, 67, 74, 85]
p03817
u867848444
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['import math\nx=int(input())\nif x<=6:\n print(0)\n exit()\n\nans=math.ceil(x/11)*2\nif ans//2*11-x>=6:\n ans+=-1\n\nprint(ans if x>11 else 1)', 'import math\nx=int(input())\nif x<=6:\n print(1)\n exit()\n\nans=math.ceil(x/11)*2\nif ans//2*11-x>=5:\n ans+=-1\n\nprint(ans if x>11 else 2)']
['Wrong Answer', 'Accepted']
['s500199079', 's715846379']
[2940.0, 3188.0]
[17.0, 18.0]
[140, 140]
p03817
u919633157
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['# 2019/08/11\n\nx=int(input())\nans=2*x//11\nif x%11>6:\n ans+=2\nelse:\n ans+=1\nprint(ans)', '\n\nx = int(input())\nd,m = divmod(x,11)\nans = d*2\nans += 1\n\nif m > 6:\n ans += 1\nelif m == 0:\n ans -= 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s482400049', 's177051487']
[2940.0, 2940.0]
[18.0, 18.0]
[90, 168]
p03817
u921773161
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\nx -=1\n\ntmp = x//11\ntmp *= 2\na = x%11\n\nif a == 0:\n tmp = tmp\nelif a <= 6:\n tmp += 1\nelse:\n tmp += 2\n\nprint(tmp)', 'x = int(input())\n\ntmp = x//11\ntmp *= 2\na = x%11\n\nif a == 0:\n tmp = tmp\nelif a <= 6:\n tmp += 1\nelse:\n tmp += 2\n\nprint(tmp)']
['Wrong Answer', 'Accepted']
['s562977458', 's018897626']
[3060.0, 3060.0]
[17.0, 17.0]
[136, 130]
p03817
u966695411
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['N = int(input())\nA = list(map(int, input().split()))\nD = {}\nfor i in A:\n if i in D:\n D[i] += 1\n else:\n D[i] = 1\ncnt = 0\nfor k in D.keys():\n if D[k] % 2:\n D[k] = 1\n else:\n D[k] = 2\n cnt += 1\nprint(len({*A}) - (cnt % 2))', 'N = int(input())\nd, m = divmod(N,...
['Runtime Error', 'Accepted']
['s241378063', 's551474392']
[3192.0, 3064.0]
[22.0, 21.0]
[265, 90]
p03817
u981931040
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\nans = x // 11 * 2\nnokori = x % 11\nif nokori > 6:\n print(ans + 2)\nif nokori == 0:\n print(ans)\nelse:\n print(ans + 1)', 'x = int(input())\nans = x // 11 * 2\nnokori = x % 11\nif nokori > 6:\n print(ans + 2)\nelif nokori == 0:\n print(ans)\nelse:\n print(ans + 1)']
['Wrong Answer', 'Accepted']
['s148453814', 's586686605']
[9072.0, 9084.0]
[31.0, 27.0]
[140, 142]
p03817
u983918956
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['x = int(input())\nt = x // 11\nx -= 11 * t\nans = t * 2\nif x <= 5:\n ans += 1\nelif 5 < x < 11:\n ans += 2\nprint(ans)za', 'x = int(input())\n\nans = 2*(x // 11)\nx %= 11\nif x == 0:\n pass\nelif 0 < x <= 6:\n ans += 1\nelif 6 < x <= 11:\n ans += 2\nprint(ans)']
['Runtime Error', 'Accepted']
['s232864176', 's964679388']
[2940.0, 3060.0]
[18.0, 17.0]
[119, 135]
p03817
u985443069
2,000
262,144
Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7. Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation: * Operation: Rotate the die 90° t...
['\ndef solve(x):\n q = (x - 1) // 11\n r = (x - 1) % 11\n if r <= 6:\n return 2 * q + 1\n return 2 * q + 2\n\nx = int(input())\nprint(solve(x))\n', '\ndef solve(x):\n q = (x - 1) // 11\n r = (x - 1) % 11\n if r <= 7:\n return 2 * q + 1\n return 2 * q + 2\n\nx = int(input())\nprint...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s356135932', 's712145571', 's288830429']
[3064.0, 3064.0, 3064.0]
[22.0, 22.0, 23.0]
[153, 153, 153]
p03818
u077291787
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['# ARC068D - Card Eater (ABC053D)\nfrom collections import Counter\n\n\ndef main():\n N = int(input())\n A = tuple(map(int, input().split()))\n C = sorted(Counter(A).values(), reverse=1)\n ans, stock = 0, 0\n for i in C:\n if i == 1:\n ans += 1\n else:\n if i >= 3:\n ...
['Wrong Answer', 'Accepted']
['s185905803', 's779959972']
[18660.0, 14280.0]
[187.0, 44.0]
[544, 208]
p03818
u091051505
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\nn = int(input())\na = [int(i) for i in input().split()]\nk = Counter(a)\nb = list(k.values())\nover_2 = [bb for bb in b if bb >= 2]\nif sum(over_2) % 2 == 1:\n print(len(b))\nelse:\n if len(over_2 == 0):\n print(len(b))\n else:\n print(len(b) - 1)', 'from collec...
['Runtime Error', 'Accepted']
['s868591243', 's807508037']
[18656.0, 18648.0]
[61.0, 65.0]
[291, 315]
p03818
u163320134
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['def calc(n):\n ret=n\n while ret>=3:\n ret=ret%3+ret//3\n return ret\n\nn=int(input())\narr=list(map(int,input().split()))\ncnt=[0]*(10**5+1)\nfor i in range(n):\n cnt[arr[i]]+=1\ncnt1=0\ncnt2=0\nfor i in range(n):\n tmp=calc(cnt[i])\n if tmp==1:\n cnt1+=1\n elif tmp==2:\n cnt2+=1\nif cnt2%2==0:\n pr...
['Wrong Answer', 'Accepted']
['s145976278', 's728525801']
[14396.0, 14396.0]
[86.0, 88.0]
[339, 345]
p03818
u205166254
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\nimport heapq\n\nn = int(input())\na = Counter(map(int, input().split()))\n\nx = []\nfor k in a:\n if a[k] > 1:\n x.append(-(a[k] - 1))\n\nheapq.heapify(x)\n\nwhile len(x) > 1:\n u = - heapq.heappop(x)\n v = - heapq.heappop(x)\n n -= v * 2\n d = u - v\n if d > ...
['Wrong Answer', 'Accepted']
['s075881211', 's377933975']
[22636.0, 22636.0]
[93.0, 89.0]
[399, 432]
p03818
u252805217
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n = input()\nl = len(set([int(x) for x in input().split()]))\nprint(l - l % 2)', 'n=input()\nl=len(set([int(x) for x in input().split()]))\nprint(l-(l+1)%2)']
['Wrong Answer', 'Accepted']
['s304624673', 's919228044']
[14396.0, 14388.0]
[68.0, 68.0]
[76, 72]
p03818
u298297089
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\nn = int(input())\na = list(map(int, input().split()))\nc = Counter(a)\nprint(len(c))', 'from collections import Counter\nn = int(input())\na = list(map(int, input().split()))\nc = Counter(a)\nlen_c = len(c)\nb = {k:v for k,v in c.items() if v > 1}\nsum_b = sum(b.values())\nif n == 3:\...
['Wrong Answer', 'Accepted']
['s638483731', 's532205253']
[18656.0, 18656.0]
[51.0, 55.0]
[113, 277]
p03818
u340781749
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\n\ninput()\nc = Counter(map(int, input().split()))\nprint(len(c))\n', 'from collections import Counter\n\ninput()\nc = Counter(map(int, input().split()))\nprint((len(c) - 1) // 2 * 2 + 1)\n']
['Wrong Answer', 'Accepted']
['s366010236', 's900599645']
[22636.0, 22636.0]
[75.0, 75.0]
[94, 113]
p03818
u402629484
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['input()\na = [0] * (100000 + 1)\n\nfor i in map(int, input().split()):\n a[i] += 1\n if a[i] == 3:\n a[i] >>= 1\n\nc = [0, a.count(1), a.count(2)]\n\nans = 0\nans += (c[2] >> 1) << 1\nans += c[1]\nans -= c[2] & 1\n\nprint(ans)\n', 'input()\na = [0] * (100000 + 1)\n\nfor i in map(int, input().split()):\n ...
['Wrong Answer', 'Accepted']
['s792257304', 's485473377']
[11488.0, 11324.0]
[79.0, 80.0]
[225, 211]
p03818
u441575327
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\n\nN = int(input())\nA = list(map(int,input().split()))\n\ncounter = Counter(A)\n\ncounts = counter.most_common()\n\ndup_num = 0\nfor i in range(len(counts)):\n if counts[i][1] != 1:\n dup_num += counts[i][1]-1\n\nprint(counts)\nif dup_num%2 == 0:\n print(N-dup_num)\nelse:...
['Wrong Answer', 'Accepted']
['s127588305', 's116859302']
[24668.0, 21980.0]
[118.0, 84.0]
[324, 310]
p03818
u493520238
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n = int(input())\nal = list(map(int, input().split())) \nal = set(al)\nif len(al)%2 == 0:\n print(len(al))\nelse:\n print(len(al)-1)\n', 'import bisect\na_list = [1,3,3,3,6,6,7,10]\nbisect.bisect_left(a_list,4) # -> 4\n\nn = int(input())\nal = list(map(int, input().split())) \n\nal.sort()\ncnt = []\ntmp = 1\nfo...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s238974386', 's249804345', 's650208373']
[14396.0, 14276.0, 14396.0]
[45.0, 98.0, 45.0]
[133, 818, 133]
p03818
u497046426
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\n\nN = int(input())\n*A, = map(int, input().split())\ncnt = Counter(A)\nans = N\nduplicates = sorted([(a, d) for a, d in cnt.items() if d > 1], key=lambda x: x[0])\noffset = 0\nfor _, d in duplicates:\n if offset: d -= offset; offset = 0;\n if d == 1: continue\n elif d % 2 == ...
['Wrong Answer', 'Accepted']
['s018944333', 's203415942']
[18656.0, 18656.0]
[62.0, 62.0]
[377, 363]
p03818
u518042385
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n=int(input())\nl=sorted(list(map(int,input().split())))\nvariety=0\ncountodd=0\ncounteven=0\ncountnow=1\nnow=l[0]\nfor i in range(1,n):\n if l[i]==now:\n countnow+=1\n else:\n now=l[i]\n if countnow%2==0:\n countodd+=1\n else:\n counteven+=1\n countnow=1\nif countnow!=0:\n if countnow%2==...
['Wrong Answer', 'Accepted']
['s156580698', 's694688486']
[14388.0, 14396.0]
[93.0, 91.0]
[426, 427]
p03818
u540761833
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['from collections import Counter\nN=int(input())\nA = list(map(int,input().split()))\nAc = Counter(A)\ndupsum = 0\ndupnum = 0\nfor v in Ac.values():\n if v > 1:\n dupsum += v-1\n dupnum += 1\nif dupnum == 1:\n print(dupsum)\nelse:\n print(dupsum-1)', 'from collections import Counter\nN=int(input...
['Wrong Answer', 'Accepted']
['s512344598', 's444708753']
[18656.0, 18656.0]
[56.0, 55.0]
[257, 211]
p03818
u625963200
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n=int(input())\nA=list(map(int,input().split()))\n\nkaburi=len(set(A))\nif kaburi%2==0:\n print(n-kaburi)\nelse:\n print(n-kaburi-1)', 'n=int(input())\nA=list(map(int,input().split()))\n\nkaburi=len(set(A))\nif kaburi%2==0:\n print(kaburi-1)\nelse:\n print(kaburi)']
['Wrong Answer', 'Accepted']
['s798858983', 's636291457']
[14396.0, 14564.0]
[45.0, 45.0]
[127, 123]
p03818
u637175065
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\ndef LI(): return list(map(int, input().split()))\ndef II(): return int(input())\ndef LS(): return input().split()\ndef S(): return input()\n\n\ndef main():\n n ...
['Wrong Answer', 'Accepted']
['s578585924', 's409397823']
[16788.0, 16788.0]
[212.0, 602.0]
[368, 414]
p03818
u648881683
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
["import bisect, collections, copy, heapq, itertools, math, string, sys\ninput = lambda: sys.stdin.readline().rstrip() \nsys.setrecursionlimit(10**7)\nINF = float('inf')\ndef I(): return int(input())\ndef F(): return float(input())\ndef SS(): return input()\ndef LI(): return [int(x) for x in input().split()]\ndef LI_()...
['Wrong Answer', 'Accepted']
['s306498542', 's108717788']
[22752.0, 22712.0]
[64.0, 90.0]
[968, 1065]
p03818
u667024514
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n = int(input())\nlis = list(map(int,input().split()))\nans = set()\nfor num in lis:ans.add(num)\nprint(len(num)-((len(num) % 2)+1)%2)', 'n = int(input())\nlis = list(map(int,input().split()))\nans = set()\nfor num in lis:ans.add(num)\nprint(len(ans)-((len(ans) % 2)+1)%2)']
['Runtime Error', 'Accepted']
['s424238743', 's303488340']
[14564.0, 14564.0]
[53.0, 53.0]
[130, 130]
p03818
u669382434
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n=int(input())\na=list(map(int,input().split()))\nsn=[0]*n\nmi2=0\nmi=0\nfor i in range(0,n):\n if sn[i]==1:\n mi2=1-mi2\n else:\n sn[i]=1\n mi+=1\nprint(mi-mi2)', 'n=int(input())\na=list(map(int,input().split()))\nsn=[0]*n\nmi2=0\nmi=0\nfor i in range(0,n):\n if sn[a[i]]==1:\n mi...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s447807909', 's982503604', 's455008351']
[14396.0, 14388.0, 14396.0]
[66.0, 70.0, 70.0]
[177, 183, 188]
p03818
u765237551
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['use std::io::stdin;\n\nfn main(){\n let x = geti64s()[0];\n let (d, m) = (x/11, x%11);\n println!("{}", match m {\n 0 => d*2,\n x if x<=6 => d*2 + 1,\n _ => d*2 + 2\n });\n}\n\n#[allow(dead_code)]\nfn getline() -> String {\n let mut s = String::new();\n match std...
['Runtime Error', 'Accepted']
['s430897276', 's871005166']
[2940.0, 22636.0]
[18.0, 67.0]
[786, 206]
p03818
u905203728
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n=int(input())\nA=list(map(int,input().split()))\nA.sort()\nprint(A)\nA_length=n-len(set(A))\nif A_length%2==0:print(A_length)\nelse:print(A_length-1)', 'n=int(input())\nA=list(map(int,input().split()))\nA.sort()\nA_l=len(set(A))\nprint(A_l if (n-A_l)%2==0 else A_l-1)']
['Wrong Answer', 'Accepted']
['s789124792', 's324083568']
[16100.0, 14692.0]
[88.0, 82.0]
[144, 110]
p03818
u984351908
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['n = int(input())\na = list(map(int, input().split()))\na.sort()\nc = 0\ne = 0\ni = 0\nwhile True:\n c += 1\n cai = 1\n while i != n - 1 and a[i] == a[i + 1]:\n cai += 1\n print(i)\n if i != n - 1:\n i += 1\n else:\n break\n if cai % 2 == 0:\n e += 1...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s360628691', 's388445088', 's054704823']
[14092.0, 14396.0, 14388.0]
[198.0, 128.0, 136.0]
[389, 257, 372]
p03818
u989306199
2,000
262,144
Snuke has decided to play a game using cards. He has a deck consisting of N cards. On the i-th card from the top, an integer A_i is written. He will perform the operation described below zero or more times, so that the values written on the remaining cards will be pairwise distinct. Find the maximum possible number of...
['import collections as col\n\nN = int(input())\nA = list(map(int, input().split()))\n\nm = col.Counter(A)\nans = len(m) if m%2==1 else len(m)-1\nprint(ans)\n\n', 'import collections as col\n\nN = int(input())\nA = list(map(int, input().split()))\n\nm = col.Counter(A)\nans = len(m) if len(m)%2==1 else len(m)-1\nprint(a...
['Runtime Error', 'Accepted']
['s794830106', 's285509372']
[21916.0, 22036.0]
[55.0, 61.0]
[149, 154]
p03821
u020390084
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
["#!/usr/bin/env python3\nimport sys\n# input = sys.stdin.r/eadline\ndef INT(): return int(input())\ndef MAP(): return map(int,input().split())\ndef LI(): return list(map(int,input().split()))\n\ndef main():\n N = int()\n A=[]\n B = []\n for _ in range(N):\n a,b = MAP()\n A.append(a)\n ...
['Wrong Answer', 'Accepted']
['s224603361', 's730070888']
[3064.0, 11060.0]
[17.0, 328.0]
[536, 536]
p03821
u048472001
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['\nN = int(input())\ntotal = 0\nA = [None] * N\nB = [None] * N\nfor i in range(N):\n A[i], B[i] = map(int, input().split())\n\t\nfor i in range(N-1,-1,-1):\n\ta = A[i] % B[i]\n\tif a == 0:\n\t\tpass\n\telse:\n\t\ttotal = total + B[i] - a\n\t\tfor j in range (i):\n\t\t\tA[i] = A[i] + B[i] - a\n\n\nprint (total)\n\t\...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s204303706', 's545238072', 's694304428']
[10996.0, 2940.0, 10868.0]
[2104.0, 17.0, 341.0]
[285, 283, 252]
p03821
u056358163
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['import fractions\n\ndef lcm(a, b):\n return a * b / fractions.gcd(a, b)\n\nN, M = map(int, input().split())\nS = input()\nT = input()\n\nd_N = {}\n\nfor n in range(N):\n d = fractions.gcd(n, N)\n d_N[(n // d, N // d)] = n\n\nfor m in range(M):\n d = fractions.gcd(m, M)\n k = (m // d, M // d)\n if k ...
['Runtime Error', 'Accepted']
['s727104646', 's578813230']
[5048.0, 12644.0]
[37.0, 364.0]
[407, 238]
p03821
u060736237
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n = int(input())\nA, B = [], []\nfor _ in range(n):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nresult = 0\nfor a, b in zip(A[::-1], B[::-1]):\n piyo = (a+result) % b\n if piyo == 0:\n continue\n result += b - piyo\nprint(result', 'n = int(input())\nA, B = [], []\nfor _ in...
['Runtime Error', 'Accepted']
['s877917127', 's780733408']
[3060.0, 12624.0]
[17.0, 348.0]
[261, 262]
p03821
u075304271
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['import numpy as np\nimport math\nimport collections\nimport fractions\nimport itertools\n\ndef iput(): return int(input())\ndef mput(): return map(int, input().split())\ndef lput(): return list(map(int, input().split()))\n\ndef solve():\n n = int(input())\n cost = 0\n for i in range(n):\n a, b = mput(...
['Wrong Answer', 'Accepted']
['s245531995', 's310250981']
[13544.0, 25052.0]
[497.0, 495.0]
[432, 566]
p03821
u077003677
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
["import sys\nimport os\n\ndef file_input():\n f = open('AGC009/input.txt', 'r')\n sys.stdin = f\n\ndef main():\n #file_input()\n N=int(input())\n A=[]\n B=[]\n for i in range(N):\n tmp=list(map(int, input().split()))\n A.append(tmp[0])\n B.append(tmp[1])\n\n cnt=0\n for ...
['Runtime Error', 'Accepted']
['s098881454', 's559736081']
[2940.0, 11112.0]
[18.0, 396.0]
[648, 646]
p03821
u077291787
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['# AGC009A - Multiple Array\ndef main():\n N, *AB = map(int, open(0).read().split())\n ans = 0\n for i, j in zip(*[iter(A[::-1])] * 2): # decide from the last one greedily\n ans += -(i + ans) % j\n print(ans)\n\n\nif __name__ == "__main__":\n main()', '# AGC009A - Multiple Array\ndef main():\n ...
['Runtime Error', 'Accepted']
['s854869476', 's811177140']
[25124.0, 25124.0]
[65.0, 87.0]
[261, 262]
p03821
u095756391
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n = int(input())\na = []\nb = []\n\nfor _ in range(n):\n c, d = map(int, input().split())\n a.append(c)\n b.append(d)\n\ns = 0\nfor i in range(n-1, -1, 1):\n r = b[i] + s % a[i]\n if r != 0:\n s += r\n \nprint(s)', 'n = int(input())\na = []\nb = []\n\nfor _ in range(n):\n c, d = map(int, i...
['Wrong Answer', 'Accepted']
['s016157796', 's374949847']
[11048.0, 11040.0]
[306.0, 348.0]
[222, 232]
p03821
u102960641
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n = int(input())\na = []\nfor i in range(n):\n a1 = list(map(int, input().split()))\n a.append(a1)\nans = 0\nb = 0\nfor i in a:\n if i[1] != 1:\n c = i[1] - (i[0]+b) % i[1]\n print(c,b)\n ans += c\n b += c\nprint(ans)', 'n = int(input())\na = []\nfor i in range(n):\n a1 = list(map(int, input().split()...
['Wrong Answer', 'Accepted']
['s249693209', 's435073763']
[30084.0, 27380.0]
[546.0, 419.0]
[219, 246]
p03821
u103902792
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n = int(input())\nA = []\nB = []\nans = 0\n\nfor _ in range(n):\n a,b = map(int,input().split())\n A.append(a)\n B.append(b)\n \nfor _ in range(n):\n a = A.pop(-1)\n b = B.pop(-1)\n a += ans\n ans += a%b\nprint(ans)', 'n = int(input())\nA = []\nB = []\nans = 0\nimport math\n\nfor _ in range(n):\n a,b = map(i...
['Wrong Answer', 'Accepted']
['s898927380', 's021714262']
[17036.0, 16892.0]
[240.0, 251.0]
[208, 240]
p03821
u107077660
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['N = int(input())\nB = [[] for _ in range(N)]\nunchecked = [i for i in range(N)]\nfor i in range(1,N):\n\tt = int(input()) - 1\n\tB[t].append(i)\nans = [0]*N\nfor i in range(N):\n\tif not B[i]:\n\t\tunchecked.remove(i)\nwhile 0 in unchecked:\n\tfor i in unchecked:\n\t\t\tf = 0\n\t\t\tC = []\n\t\t\tfor a in B[i]:\n\t\t...
['Runtime Error', 'Accepted']
['s488582758', 's252539039']
[14260.0, 21156.0]
[59.0, 455.0]
[502, 162]
p03821
u137667583
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n = int(input())\na, b = [0]*n,[0]*n\ncount = 0\nfor i in range(n):\n a[i],b[i] = map(int,input().split())\n\nwhile(n > 0):\n count += (a[n-1]+count)%b[n-1]\n n-=1\n\nprint(count)', 'n = int(input())\na, b = [0]*n,[0]*n\ncount = 0\nfor i in range(n):\n a[i],b[i] = map(int,input().split())\n\nwhile(n > 0):...
['Wrong Answer', 'Accepted']
['s002766781', 's241970134']
[10868.0, 10868.0]
[344.0, 357.0]
[178, 214]
p03821
u185896732
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['#import pysnooper\n\n#from collections import Counter,deque\n#from operator import itemgetter\n#from itertools import accumulate,combinations,groupby\nfrom sys import stdin,setrecursionlimit\n#from copy import deepcopy\nsetrecursionlimit(10**6)\n\nn=int(stdin.readline().rstrip())\na=[tuple(map(int,stdin.readline().rs...
['Wrong Answer', 'Accepted']
['s997614407', 's669968181']
[17656.0, 16612.0]
[303.0, 217.0]
[497, 501]
p03821
u212328220
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['N = int(input())\nal = []\nbl = []\nfor i in range(N):\n a,b = map(int,input().split())\n al.append(a)\n bl.append(b)\nal.reverse()\nbl.reverse()\n\nplus = 0\nfor i in range(N):\n if al[i]+plus > bl[i]:\n amari = (al[i]+plus) % bl[i]\n syo = (al[i]+plus) // bl[i]\n if amari != 0:\n ...
['Wrong Answer', 'Accepted']
['s847222078', 's235271991']
[16948.0, 27212.0]
[2206.0, 280.0]
[520, 282]
p03821
u215630013
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n = int(input())\nls = []\nfor i in range(n):\n a,b = map(int, input().split())\n ls.append((a,b))\ncnt = 0\nfor i, j in sorted(ls, reverse=True):\n m = (i+cnt) % j\n cnt += 0 if m == 0 else j-m\nprint(cnt)', 'n = int(input())\nls = []\nfor i in range(n):\n a,b = map(int, input().split())\n ls.appen...
['Wrong Answer', 'Accepted']
['s184796250', 's603446434']
[17756.0, 17428.0]
[476.0, 368.0]
[209, 195]
p03821
u227082700
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n,a,b=int(input()),[],[]\nfor i in range(n):x,y=map(int,input().split());a.append(x);b.append(y)\nr=0\nfor i in range(n):r+=(b[n-i-1]*(((a[n-i-1]+r-1)//b[n-1-i])+1))-a[n-1-i]\nprint(r)', 'n,a,b=int(input()),[],[]\nfor i in range(n):x,y=map(int,input().split());a.append(x);b.append(y)\na,b=a[::-1],b[::-1]\nr=0\nfor i ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s046955314', 's078142655', 's544590706', 's701828156', 's129587597']
[11048.0, 12584.0, 27428.0, 29412.0, 15020.0]
[2104.0, 2104.0, 2105.0, 2105.0, 373.0]
[180, 184, 155, 149, 189]
p03821
u243492642
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['# coding: utf-8\nnum_N = int(input())\nl_A = []\nl_B = []\nfor __ in range(num_N):\n l_info = list(map(int, input().split()))\n l_A.append(l_info[0])\n l_B.append(l_info[1])\n \nl_A.append(0)\nl_B.append(0)\nl_A.reverse()\nl_B.reverse()\n \nans = 0\n \nfor i in range(1, num_N + 1):\n if l_A[i] + ans == l_...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s086906631', 's621921701', 's842724950']
[11868.0, 11884.0, 27380.0]
[2104.0, 2108.0, 375.0]
[557, 552, 208]
p03821
u268792407
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['n=int(input())\nans=0\nfor i in range(n):\n a,b=map(int,input().split())\n ans += (b-a%b)%b\nprint(ans)', 'n=int(input())\nab=[list(map(int,input().split())) for i in range(n)]\nm=0\nfor i in range(n):\n i=n-1-i\n a,b=ab[i][0]+m,ab[i][1]\n m+=(b-a%b)%b\nprint(m)']
['Wrong Answer', 'Accepted']
['s308680998', 's803570507']
[3060.0, 27380.0]
[329.0, 389.0]
[100, 151]
p03821
u276204978
2,000
262,144
There are an integer sequence A_1,...,A_N consisting of N terms, and N buttons. When the i-th (1 ≦ i ≦ N) button is pressed, the values of the i terms from the first through the i-th are all incremented by 1. There is also another integer sequence B_1,...,B_N. Takahashi will push the buttons some number of times so th...
['import numpy as np\n\nN = int(input())\nA = np.zeros(N).astype(int)\nB = np.zeros(N).astype(int)\n\nfor i in range(N):\n A[i], B[i] = map(int, input().split())\n\nans = 0\nfor i in reversed(range(N)):\n \tA[i] = A[i] + ans\n if A[i] % B[i] == 0:\n continue\n elif B[i] - A[i] > 0:\n ans += B[i]...
['Runtime Error', 'Accepted']
['s363839959', 's085578192']
[2940.0, 14168.0]
[17.0, 773.0]
[371, 319]