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
p03363
u374103100
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['\n\nimport math\n\n\ndef combinations_count(n, r):\n return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))\n\n\ndef convert_map(l):\n d = {}\n for i in l:\n if i in d:\n d[i] += 1\n else:\n d[i] = 1\n return d\n\n\nN = list(map(int, input()))[0]\n\nli ...
['Wrong Answer', 'Accepted']
['s753929484', 's216834859']
[48848.0, 41472.0]
[1531.0, 1516.0]
[625, 629]
p03363
u375695365
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import collections\nn = int(input())\na = list(map(int, input().split()))\nb = [a[0]]\nfor i in range(1, n):\n b.append(b[i-1]+a[i])\nprint(b)\nans = b.count(0)\nd = collections.Counter(b)\nfor i in d.values():\n ans += i*(i-1)//2 \n\nprint(ans)\n', 'import collections\nn = int(input())\na = list(map(int, input...
['Wrong Answer', 'Accepted']
['s339472974', 's296175722']
[46960.0, 44284.0]
[191.0, 172.0]
[260, 253]
p03363
u379959788
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['# AGC023\nimport collections\nfrom scipy.misc import comb\nN = int(input())\nA = list(map(int, input().split()))\nans = 0\nS = [0] * (N+1)\nfor i in range(N):\n S[i+1] = S[i] + A[i]\nc = collections.Counter(S)\nc = c.most_common()\nfor i in range(len(c)):\n if c[i][1] == 1:\n pass\n if c[i][1] == 2:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s614923597', 's717016010', 's229487507']
[58460.0, 51428.0, 48708.0]
[2111.0, 379.0, 261.0]
[377, 300, 325]
p03363
u384679440
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nA = list(map(int, input().split()))\nS = [0]\nans = 0\nfor i in range(len(A)):\n S.append(S[i] + A[i])\nS.sort()\ncount = 1\nfor i in range(1, len(S)):\n if S[i-1] == S[i]:\n count += 1\n else:\n ans += count * (count-1) / 2\n count = 1\nans += count * (count-1) / 2\nprint(ans)', 'N = in...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s613360386', 's746605978', 's335179437']
[25976.0, 8784.0, 26004.0]
[237.0, 21.0, 250.0]
[293, 285, 298]
p03363
u391533749
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nA = list(map(int, input().split()))\nB = [0]\nt = 0\nfor i in range(N):\n B.append(B[i] + A[i])\n \nC = set(B)\nfor j in C:\n z = B.count(j)\n if count > 1:\n t += z*(z-1)/2\n \nprint(int(t))', 'N = int(input())\nA = list(map(int, input().split()))\nB = {}\nt = 0\nx = 0\nB[0] = 1\nfo...
['Runtime Error', 'Accepted']
['s648190524', 's950082280']
[32748.0, 39704.0]
[149.0, 195.0]
[212, 161]
p03363
u394721319
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\nimport collections\n\nN = int(input())\nA = [int(i) for i in input().split()]\n\nB = [0] + A\nB = list(accumulate(B))\n\nc = collections.Counter(B)\ncm = c.most_common()\n\ncnt = 0\nfor v in cm:\n if v[1] > 1:\n cnt += (v[1]*(v[1]-1)//2)\n', 'from itertools import accumulat...
['Wrong Answer', 'Accepted']
['s252615806', 's128826673']
[48136.0, 53096.0]
[225.0, 219.0]
[267, 240]
p03363
u404676457
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import itertools as itr\nn = int(input())\na = list(map(int, input().split()))\nitra = list(itr.accumulate(a))\nans_c = itra.count(0)\nseta = list(set(itra))\nprint(seta)\nfor i in seta:\n tmp_c = itra.count(i)\n ans_c += tmp_c * (tmp_c - 1) // 2\nprint(ans_c)', 'import itertools as itr\nimport collections as c...
['Wrong Answer', 'Accepted']
['s246622241', 's483175902']
[32784.0, 50536.0]
[2105.0, 276.0]
[256, 254]
p03363
u405256066
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import numpy as np\nfrom sys import stdin\nN=int(stdin.readline().rstrip())\na=[]\nfor i in range(N):\n a.append([int(x) for x in stdin.readline().rstrip().split()])\n\nres = np.cumsum(data)\nres=np.insert(res,0,0)\nans=0\ntmp=float("inf")\nfor i in sorted(res):\n if i == tmp:\n ans+=1\n tmp=i\nprint(...
['Runtime Error', 'Accepted']
['s309307608', 's553573116']
[34672.0, 34560.0]
[1209.0, 411.0]
[307, 374]
p03363
u406138190
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from collections import Counter\nn=int(input())\na=list(map(int,input().split()))\nans=0\naccum = [0]*(n+1)\naccum[0]=0\nfor i in range(n):\n accum[i+1]=a[i]+accum[i]\n\nz=Counter(accum)\nfor k,v in z:\n ans+=n(n-1)/2\n \nprint(ans)\n', 'from collections import Counter\nn=int(input())\na=list(map(int,input()...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s626751524', 's935979920', 's625633097']
[41752.0, 41672.0, 41672.0]
[164.0, 207.0, 212.0]
[229, 237, 243]
p03363
u408375121
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\na = list(map(int, input().split()))\ndic = {}\ndic[0] = 1\ntotal = 0\nfor i in range(n):\n total += a[i]\n dic[total] += 1\nans = 0\nfor v in dic.values():\n ans += v*(v-1) // 2\nprint(ans)', 'n = int(input())\na = list(map(int, input().split()))\ndic = {}\ndic[0] = 1\ntotal = 0\nfor i in range(n...
['Runtime Error', 'Accepted']
['s810828492', 's189552888']
[26720.0, 39508.0]
[93.0, 185.0]
[199, 248]
p03363
u471214054
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import math\n\nn = int(input())\na = list(map(int, input().split()))\ns = [0]\nb = 0\n\nfor i in range(n):\n s.append(s[i] + a[i])\ns.sort()\n\nfor i in set(s):\n b += math.factorial(s.count(i)-1)\nprint(b)\n', 'n = int(input())\na = list(map(int, input().split()))\ncount = 0\nsum = 0\n\nprint(a)\nfor i in rang...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s111226953', 's120389610', 's167014809']
[33116.0, 26716.0, 26720.0]
[2105.0, 2104.0, 282.0]
[200, 218, 269]
p03363
u476604182
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
["from itertools import accumulate\nfrom collections import Counter\nN,*A = map(int, open('0').read().split())\nB = accumulate(A)\nc = Counter(B)\nans = c[0]+sum(v*(v-1)//2 for v in c.values())\nprint(ans)", 'from itertools import accumulate\nfrom collections import Counter\nN,*A = map(int, open(0).read().split())\nB =...
['Runtime Error', 'Accepted']
['s765012656', 's780549270']
[3316.0, 38928.0]
[20.0, 142.0]
[197, 195]
p03363
u503294750
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from collections import Counter\n\nN=int(input())\ns=list(map(int,input().split()))\n\nresult=[0]\nfor i in s:\n\tresult.append(result[-1]+i)\n\nprint(result) \n\na=Counter(result)\nans=0\nfor j in a.values():\n\tans+=j*(j-1)//2\n\nprint(ans)', 'from collections import Counter\n\nN=int(input())\ns=list(map(int,inp...
['Wrong Answer', 'Accepted']
['s701259276', 's700057734']
[46944.0, 44412.0]
[178.0, 159.0]
[227, 208]
p03363
u504562455
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import bisect\nfrom collections import deque\nn = int(input())\na = [int(i) for i in input().split()]\n\n\na_sum = [0]\nfor i in range(n):\n a_sum.append((a_sum[-1]+a[i]))\n\nval = deque()\ncnt = deque()\nfor i in range(n+1):\n \n idx = 0\n if len(val) > idx and val[idx] == a_sum[i]:\n cnt[idx] += ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s114653523', 's717294073', 's809533568', 's166932221']
[27508.0, 3064.0, 27516.0, 41568.0]
[126.0, 17.0, 2105.0, 200.0]
[494, 484, 471, 242]
p03363
u517152997
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import math\n\nn = int(input())\na = [int(i) for i in input().split()]\n\n#print(n)\n#print(a)\nanswer = 0\nb=[0]\nfor i in range(n):\n b.append(b[i]+a[i])\nc=sorted(b)\nprint(b)\nprint(c)\nrenzoku = 0\nfor i in range(1,n+1):\n if c[i-1] == c[i]:\n renzoku += 1\n elif renzoku > 0:\n answer += m...
['Wrong Answer', 'Accepted']
['s803035988', 's073423078']
[36984.0, 34556.0]
[2105.0, 370.0]
[461, 483]
p03363
u517447467
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nnumbers = list(map(int, input().split()))\n \nsums = [0] * (N + 1)\nfor i in range(len(numbers)):\n sums[i] = sums[i-1]+numbers[i]\nsums = sorted(sums)\n\ntemp = ""\ncount = 0\nres = 0\nfor i in range(len(sums)):\n if temp == sums[i]:\n count += 1\n else:\n if count >= 2:\n print(count...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s445220847', 's536545171', 's637729963']
[25976.0, 20072.0, 26136.0]
[234.0, 2108.0, 235.0]
[529, 173, 510]
p03363
u518042385
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n=int(input())\nl=list(map(int,input().split()))\nc=0\nl1=[]\nfor i in l:\n c+=i\n l1.append(c)\nl2={}\nfor i in l1:\n if i in l2:\n l2[i]+=1\n else:\n l2[i]=1\ns=0\nfor i in l2:\n s+=l2[i]*(l2[i]-1)/2\nprint(s)', 'n=int(input())\nl=list(map(int,input().split()))\nc=0\nl1=[]\nfor i in l:\n c+=i\n l1.appe...
['Wrong Answer', 'Accepted']
['s733498990', 's855727416']
[41108.0, 41228.0]
[217.0, 217.0]
[206, 231]
p03363
u532966492
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N=int(input())\nL=list(map(int,input().split()))\nN=200000\nL=[i for i in range(N)]\nLeft=[[0,0]]\nRight=[[0,N]]\nfor i in range(N):\n Left.append([Left[i][0]+L[i],i+1])\nfor i in range(N):\n Right.append([Right[i][0]+L[i*(-1)-1],N-i-1])\nRight=list(reversed(Right))\nLeft=sorted(Left, key=lambda x: x[0])\n_sum_...
['Wrong Answer', 'Accepted']
['s931944447', 's425938511']
[85940.0, 84132.0]
[806.0, 1363.0]
[918, 886]
p03363
u537782349
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['a, b = map(int, input().split())\nc = list(map(int, input().split()))\n', 'a = int(input())\nb = list(map(int, input().split()))\nc = {0: 1}\nd = 0\nfor i in range(len(b)):\n d += b[i]\n if d not in c:\n c[d] = 1\n else:\n c[d] += 1\ne = 0\nfor k in c.keys():\n if c[k] >= 2:\n e += c[...
['Runtime Error', 'Accepted']
['s063469917', 's215588210']
[2940.0, 38644.0]
[17.0, 206.0]
[69, 260]
p03363
u551373727
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\na = list(map(int, input().split()))\n\ns = sum(a)\nb = []\nc = []\nt = 0\n\n\nfor i in a:\n b.append(t)\n t += i\n c.append(s-t)\n \nprint(b, c)\ncu = list(set(c))\n\nans = 0\nfor i in range(n-1):\n if s-b[i] not in cu:\n continue\n for j in range(i, n):\n if b[i] + c...
['Wrong Answer', 'Accepted']
['s249904532', 's179324742']
[49596.0, 38676.0]
[2106.0, 168.0]
[363, 192]
p03363
u557792847
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N, Q = map(int, input().split())\nS = input()\nqn = [list(map(int, input().split())) for _ in range(Q)]\ncnt = [0 for _ in range(N+10)]\nfor i in range(1, N+1):\n if (S[i-1:i+1] == "AC"):\n cnt[i] = cnt[i-1] + 1\n else:\n cnt[i] = cnt[i-1]\nfor q in qn:\n l, r = q\n print(cnt[r-1] - cnt[l-1]...
['Runtime Error', 'Accepted']
['s246951237', 's759314513']
[9152.0, 61572.0]
[28.0, 244.0]
[309, 454]
p03363
u588341295
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
["# -*- coding: utf-8 -*-\n\n\n\nimport sys, re\nfrom collections import deque, defaultdict, Counter\nfrom math import sqrt, hypot, factorial, pi, sin, cos, radians\nif sys.version_info.minor >= 5: from math import gcd\nelse: from fractions import gcd \nfrom heapq import heappop, heappush, heapify, heappushpop\nfrom bi...
['Time Limit Exceeded', 'Accepted']
['s004744964', 's975784194']
[0.0, 43112.0]
[2298.0, 1545.0]
[1828, 1438]
p03363
u591295155
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['def subarraySum(nums, k):\n count = total = 0\n cache = collections.defaultdict(int)\n cache[0] = 1\n for num in nums:\n total += num\n count += cache[total - k]\n cache[total] += 1\n return count\nA = input()\nnums = list(map(int,input().split()))\nk = 0\nprint(subarraySum(nums, 0))', 'import collect...
['Runtime Error', 'Accepted']
['s800979054', 's869890648']
[27260.0, 39936.0]
[123.0, 193.0]
[288, 327]
p03363
u667024514
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
["from collections import Counter\nn = int(input())\nlis = list(map(int,input().split()))\nli = [0]\nl = ['0']\nans = set()\nfor i in range(n):\n ans.add(str(li[-1] + lis[i]))\n l.append(str(li[-1] + lis[i]))\n li.append(li[-1] + lis[i])\ncou = 0\nfor num in ans:\n co = l.count(str(num))\n co -= 1\n th = 1\n whi...
['Wrong Answer', 'Accepted']
['s894901574', 's350614022']
[57820.0, 26720.0]
[2107.0, 262.0]
[361, 227]
p03363
u675296835
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['a', 'n = int(input());\na = list(map(int,input().split()))\n\nans = 0;\ns = [0]*(n+1);\nm = {};\nfor i in range(0,n):\n s[i+1] = s[i]+a[i];\nfor i in range(0,n+1):\n m.setdefault(s[i],0);\n m[s[i]]+=1;\nfor v in m.values():\n ans += v*(v-1)//2\nprint(ans);']
['Runtime Error', 'Accepted']
['s589095563', 's340259688']
[9068.0, 43988.0]
[27.0, 200.0]
[1, 242]
p03363
u679325651
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import math\nN = int(input())\nAAA = [int(i) for i in input().split()]\nBBB = [0]\nfor a in AAA:\n BBB.append(a+BBB[-1])\nans=[]\nprint(BBB)\nBBB=sorted(BBB)\nprint(BBB)\nprev = math.inf\nbuff=BBB[0]\nans=[]\nfor i,b in enumerate(BBB):\n \n if b==prev:\n buff+=1\n else:\n if buff>=2:\n ...
['Runtime Error', 'Accepted']
['s464188721', 's535558225']
[37152.0, 26136.0]
[224.0, 225.0]
[483, 477]
p03363
u703442202
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\nn = int(input())\na_list = list(map(int,input.split()))\ncumsum = accumulate(a_list)\nnum_dict = {0:1}\nfor s in cumsum :\n if str(s) in num_list.keys:\n num_dict[str(s)] += 1\n else:\n num_dict[str(s)] = 1\n\nres = 0\nfor val in numdict:\n res += val * (val - 1)/2\n \nprin...
['Runtime Error', 'Accepted']
['s706598727', 's538387932']
[3060.0, 41360.0]
[17.0, 174.0]
[312, 318]
p03363
u703890795
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import collections\nN = int(input())\nA = list(map(int, input().split()))\nS = [A[0]]\nfor i in range(len(A)-1):\n S.append(A[i+1]+S[i])\nL = list(collections.Counter(S).values())\ns = 0\nfor l in L:\n s += int((l-1)*l//2)\nprint(s)', 'import collections\nN = int(input())\nA = list(map(int, input().split()))\nS = [...
['Wrong Answer', 'Accepted']
['s989793994', 's835260035']
[41696.0, 41696.0]
[210.0, 218.0]
[224, 217]
p03363
u707249336
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['a=int(input())\nb=list(map(int, input().split(" ")))\nc=0\nd=0\ne={0:1}\nfor i in b:\n c+=i\n d+=e.get(c,0)\n e[c]=e.get(c,0)+1\n', 'a=int(input())\nb=list(map(int, input().split(" ")))\nc=0\nd=0\ne={0:1}\nfor i in b:\n c+=i\n d+=e.get(c,0)\n e[c]=e.get(c,0)+1\n\nprint(d)\n']
['Wrong Answer', 'Accepted']
['s936244977', 's976541678']
[39544.0, 39564.0]
[198.0, 197.0]
[120, 130]
p03363
u740284863
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\nfrom collections import Counter\nn = int(input())\nnums = list(map(int,input().split()))\ns = [0]+list(accumulate(nums))\nans = 0\nfor i in Counter(S).values():\n if i > 1:\n ans += i * (i - 1) // 2\nprint(ans)', 'from itertools import accumulate\nfrom collections import Co...
['Runtime Error', 'Accepted']
['s197546127', 's707541706']
[25980.0, 41984.0]
[87.0, 128.0]
[245, 245]
p03363
u760171369
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
["import numpy as np\nN = int(input())\nA = np.array([0] + list(map(int, input().split())))\nB = np.cumsum(A)\nB.sort()\ncnt = 1\nout = 0\nfor k in range(N):\n if B[k] == B[k+1]:\n cnt += 1\n if k == N-1:\n out += (cnt * (cnt - 1)) // 2\n print('cnt: {}'.format(cnt))\n else:\n out += (cnt * (cnt - 1)...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s196958156', 's289806289', 's239079423']
[34648.0, 34648.0, 34560.0]
[585.0, 298.0, 347.0]
[366, 204, 300]
p03363
u760771686
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nS = list(map(int, input().split()))\nA = {}\nt = 0\nans = 0\nfor s in S:\n t+=s\n if s in A:\n ans+=A[s]\n A[s]+=1\n else:\n A[s]=0\n\nprint(ans)', 'N = int(input())\nS = list(map(int, input().split()))\nA = {}\nt = 0\nans = 0\nfor s in S:\n t+=s\n if t == 0:\n ans+=1\n i...
['Wrong Answer', 'Accepted']
['s864611310', 's177414992']
[33812.0, 39564.0]
[155.0, 169.0]
[162, 210]
p03363
u762420987
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\nfrom collections import Counter\nN = int(input())\nAlist = [0]+list(map(int, input().split()))\ncumsum = Counter(sorted(list(accumulate(Alist)))).most_common()\nans = 0\n\nfor k, v in cumsum:\n if v > 1:\n ans += n*(n-1)//2\n else:\n break\nprint(ans)\n', 'from it...
['Runtime Error', 'Accepted']
['s554748176', 's052676722']
[48136.0, 48508.0]
[252.0, 250.0]
[294, 294]
p03363
u766684188
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\nfrom collections import Counter\nimport sys\nsys.setrecursionlimit(10**9)\ninput=sys.stdin.readline\nn=int(input())\nA=list(map(int,input().split()))\nS=list(accumulate(A))\nC=Counter(S)\n\ndef num(m):\n return m*(m-1)//2\n\nans=0\nfor k,v in C.items():\n if k==0:\n ans+...
['Runtime Error', 'Accepted']
['s755865694', 's832505598']
[41440.0, 41448.0]
[165.0, 164.0]
[348, 347]
p03363
u771532493
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N=int(input())\nlst=[int(i) for i in input().split()]\nans=0\nfor i in range(N-1):\n j=i+1\n a=lst[i]\n while j<=N-1:\n if a==0:\n ans+=1\n a+=lst[j]\nprint(ans)', 'import numpy \nimport collections\nN=int(input())\nlst=[int(i) for i in input().split()]\nlst.insert(0,0)\nres=numpy.cumsum(lst)\ns=collect...
['Wrong Answer', 'Accepted']
['s686182076', 's119171337']
[25976.0, 45952.0]
[2104.0, 342.0]
[165, 209]
p03363
u780962115
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n=int(input())\nlists=list(map(int,input().split()))\nlistsa=[0]\ns=0\nfor i in range(n):\n s+=lists[i]\n \n listsa.append(s)\nuselists=sorted(listsa)\nprint(uselists)\nimport collections\nans=collections.Counter(uselists)\na=0\nfor i in ans.values():\n a+=i-1\nprint(a)', 'n=int(input())\nlists=list(map(int,...
['Wrong Answer', 'Accepted']
['s111427300', 's499539809']
[45788.0, 42996.0]
[265.0, 249.0]
[264, 260]
p03363
u790877102
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\na = []\nfor i in range(n):\n a.append(input())\n\nfor i in range(n):\n a.append(a[i])\n\n\nx = 0\n\nfor i in range(n):\n for j in range(n):\n for k in range(j+1):\n if a[i+j][k]==a[i+k][j]:\n continue\n else:\n break\n else:\...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s259040931', 's507946577', 's780459712', 's800538734', 's250746766']
[7156.0, 41660.0, 25976.0, 25976.0, 61540.0]
[21.0, 163.0, 2104.0, 119.0, 396.0]
[374, 248, 119, 230, 270]
p03363
u813102292
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\na = list(int(i) for i in input().split())\nsa = [0] * n\n\nfor i in range(n-1):\n if i == 0:\n sa[i] = a[i]\n else:\n sa[i + 1] = sa[i] + a[i + 1]\n\nprint(sa.count(0))', '\nn = int(input())\na = list(int(i) for i in input().split())\nsa = [0] * (n+1)\nnum_cnt = {} \n\nfor i i...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s301670860', 's942851757', 's829614073']
[25976.0, 41268.0, 41148.0]
[152.0, 192.0, 218.0]
[207, 322, 318]
p03363
u848263468
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nS = [input() for _ in range(N)]\nT = ["".join(s) for s in zip(*S)]\n \nans = 0\nfor _ in range(N):\n ans += (S == T)\n S = [s[-1] + s[:-1] for s in S]\n T = T[-1:] + T[:-1]\n \nprint(N * ans)', 'N = int(input())\nA = list(map(int, input().split()))\nS = [0]*(N+1)\nfor n in range(N):\n S[...
['Runtime Error', 'Accepted']
['s404710284', 's535729258']
[13088.0, 43884.0]
[29.0, 224.0]
[208, 284]
p03363
u857428111
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['# coding: utf-8\n# Your code here!\n# coding: utf-8\nimport sys\nsys.setrecursionlimit(200000000)\n\n\n# my functions here!\n\n\n\ndef pin(type=int):\n return map(type,input().rstrip().split())\nfrom collections import Counter \ndef resolve():\n N,=pin()\n A=list(pin())\n S=[sum(A[:i])for i in range(N+...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s596363950', 's885759416', 's194506929']
[29844.0, 29900.0, 34168.0]
[2105.0, 2105.0, 128.0]
[1463, 2401, 630]
p03363
u859897687
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n=int(input())\nl=list(map(int,input().split()))\ns=set(l)\nans=0\nfor i in s:\n a=l.count(i)\n ans+=a*(a-1)//2\nprint(ans)', 'n=int(input())\nl=list(map(int,input()))\ns=set(l)\nans=0\nfor i in s:\n a=l.count(i)\n ans+=a*(a-1)//2\nprint(ans)', 'n=int(input())\nl=[0]+list(map(int,input().split()))\ns=set(l)\nfor ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s551825905', 's623363097', 's743291942', 's594562413']
[26620.0, 8784.0, 29592.0, 36372.0]
[2104.0, 21.0, 2105.0, 204.0]
[118, 110, 162, 210]
p03363
u879870653
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nA = list(map(int,input().split()))\nanswer = 0\nfor i in range(len(A)) :\n for j in range(i+1,len(A)) :\n p = 0\n p += A[j]\n if A[i] == A[j] :\n answer += 1\nprint(answer)\n\n', 'from math import factorial\nN = int(input())\nA = list(map(int,input().split()))\nL =...
['Wrong Answer', 'Accepted']
['s711792996', 's120098331']
[26000.0, 41436.0]
[2104.0, 1554.0]
[218, 418]
p03363
u886482185
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
["n = int(input())\n\ns = []\nfor i in range(n):\n s.append(list(input()))\n\nresult = 0\nfor offset in range(n):\n is_symmetry = True\n for i in range(n):\n for j in range(i+1, n):\n if s[i][(j+offset)%n] != s[j][(i+offset)%n]:\n is_symmetry = False\n break\n ...
['Runtime Error', 'Accepted']
['s706861146', 's271305714']
[23292.0, 25976.0]
[54.0, 240.0]
[440, 320]
p03363
u894953648
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import collections\n\ndef comb2(n):\n return (n*n-1)//2\n\nn=int(input())\na=list(map(int,input().split()))\n\nsums=[0]\nfor i in range(n):\n sums.append(sums[i]+a[i])\nprint(sums)\ncounts=collections.Counter(sums)\nprint(counts)\n\nres=0\n\nfor i in counts:\n res += comb2(counts[i])\nprint(res)', 'import co...
['Wrong Answer', 'Accepted']
['s521837834', 's978556320']
[65112.0, 41716.0]
[422.0, 264.0]
[286, 262]
p03363
u900688325
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['N = int(input())\nA_list = list(map(int, input().split()))\nimport math\n\nruiseki_A_list = [0 for _ in range(N)]\n\nfor i in range(N):\n if i == 0:\n ruiseki_A_list[i] = A_list[i]\n else:\n ruiseki_A_list[i] = A_list[i] + ruiseki_A_list[i-1]\n\n\n\nruiseki_A_list.insert(0,0)\nans = 0\n\n\nruiseki...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s264036092', 's378405749', 's417349570', 's812378134', 's933924055', 's197767687']
[25604.0, 25976.0, 25724.0, 25604.0, 25604.0, 25604.0]
[1571.0, 2105.0, 1572.0, 1586.0, 1581.0, 1565.0]
[1050, 566, 701, 1055, 988, 1048]
p03363
u905582793
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\nfrom collections import Counter\nimport sys\ninput = sys.stdin.readline\nn = int(input())\na = [0]\na.extend(map(int,input().split()))\na = list(accumulate(a))\nc = Counter(a)\nans = 0\nfor i in c.values():\n ans+=i*(i-1)//2', 'from itertools import accumulate\nfrom collections impo...
['Wrong Answer', 'Accepted']
['s666623890', 's161563510']
[34048.0, 34040.0]
[158.0, 152.0]
[248, 259]
p03363
u906501980
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\nA = [int(i) for i in input().split()]\nS = [A[0]]\nfor i in range(n+1):\n S[i+1] = S[i] + A[i]\nout = 0\nfor i in set(S):\n num = S.count(i)\n out += num*(num-1)//2\nprint(out)', 'n = int(input())\nA = [int(i) for i in input().split()]\ncount = 0\nfor j in range(n):\n for k in range(1,n-...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s095666064', 's211997560', 's835971720', 's957064612', 's522538587']
[25976.0, 145500.0, 7160.0, 25976.0, 41496.0]
[77.0, 2119.0, 22.0, 191.0, 175.0]
[194, 204, 184, 142, 217]
p03363
u944209426
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['import math\nimport collections\nn = int(input())\na = list(map(int, input().split()))\nans=0\nx=[a[0]]\nfor i in range(1,n):\n x.append(a[i]+x[i-1])\nprint(x)\nc = collections.Counter(x)\nprint(c)\nfor i in c.items():\n if i[1]>=2:\n ans+=math.factorial(i[1]-1)\nprint(ans)', 'import math\nimport collect...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s005898879', 's466922650', 's829486123']
[65180.0, 2940.0, 47984.0]
[2105.0, 17.0, 282.0]
[273, 252, 426]
p03363
u945418216
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\naa = list(map(int, input().split()))\n\ns =[0]*(n+1)\nfor i in range(n):\n s[i+1] = s[i] + aa[i]\nprint(sorted(s))\nans=0\nfor x in set(s):\n c = s.count(x)\n ans+= c*(c-1)//2\nprint(ans)', 'from collections import Counter\nfrom itertools import accumulate\nn = int(input())\naa = list(map(i...
['Wrong Answer', 'Accepted']
['s354626007', 's030193684']
[39480.0, 41984.0]
[2105.0, 165.0]
[203, 232]
p03363
u950708010
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from math import factorial\nimport sys\ninput = sys.stdin.readline\ndef ncr(n,r):\n if n <= 1:\n return 0\n else:\n return factorial(n) / factorial(r) / factorial(n - r)\n\nn= int(input())\na = list(int(i) for i in input().split())\ns = [0]\nfor i in range(n):\n s.append(s[i]+a[i])\ns = sorted(s,reverse =True)\na...
['Wrong Answer', 'Accepted']
['s036684442', 's507062751']
[27268.0, 27268.0]
[262.0, 1569.0]
[436, 458]
p03363
u957084285
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\nA = list(map(int, input().split()))\nfor i in range(1, n):\n A[i] = A[i] + A[i-1]\nans = 0\nA.sort()\np = A[0]\ncount = 1\nfor i in range(1, n):\n x = A[i]\n if x == p:\n count += 1\n else:\n ans += count * (count-1)//2\n count = 1\n p = x\nans += count * (cou...
['Wrong Answer', 'Accepted']
['s173730145', 's983450183']
[25724.0, 25976.0]
[244.0, 274.0]
[322, 394]
p03363
u968404618
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from itertools import accumulate\n\nn = int(input())\nA = list(map(int, input().split()))\nS = list(accumulate(A))\nprint(A)\nprint(S)\n\n\ncnt = 0\ntmp = 0\nfor i in range(n):\n if S[i] == 0 or S[i] == tmp:\n cnt += 1\n tmp = S[i-1]\nprint(cnt)', 'from itertools import accumulate\nimport collections\n\nn = in...
['Wrong Answer', 'Accepted']
['s145957646', 's103329260']
[33628.0, 48272.0]
[155.0, 213.0]
[237, 265]
p03363
u969808621
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['from collections import defaultdict\n\nn = int(input())\na = list(map(int, input().split()))\n\ns = [0 for i in range(n+1)]\nnums = {}\nnums = defaultdict(int)\nfor i in range(0,n):\n\ts[i+1] = s[i] + a[i]\n\nfor i in range(0,n):\n\tnums[s[i]]+=1\n\nres = 0\nfor key in nums:\n\t#print("key ",key," value ",nums[key])\...
['Wrong Answer', 'Accepted']
['s429619539', 's515878979']
[41752.0, 41752.0]
[282.0, 304.0]
[355, 357]
p03363
u977389981
2,000
262,144
We have an integer sequence A, whose length is N. Find the number of the non-empty **contiguous** subsequences of A whose sums are 0. Note that we are counting **the ways to take out subsequences**. That is, even if the contents of some two subsequences are the same, they are counted individually if they are taken fro...
['n = int(input())\nA = [int(i) for i in input().split()]\n\ncnt = 0\nfor i in range(n):\n for j in range(i + 1, n + 1):\n if sum(A[i : j]) == 0:\n cnt += 1\n print(A[i : j])\n\nprint(cnt)', 'from collections import Counter\n\nn = int(input())\nA = [int(i) for i in input().split()]\n\nS ...
['Wrong Answer', 'Accepted']
['s414821655', 's184836401']
[84560.0, 41504.0]
[2104.0, 208.0]
[208, 260]
p03364
u145600939
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['n = int(input())\ns = [list(input()) for i in range(h)]\ns += s\n\ndef ok(array):\n for i in range(1,n):\n for j in range(i):\n if array[i][j] != array[j][i]:\n return False\n return True\nans = 0\nfor i in range(n-1):\n if ok(s[i:i+n]):\n ans += n\nprint(ans)\n', 'n =...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s217030547', 's866264499', 's660595112']
[3060.0, 3828.0, 3956.0]
[17.0, 1642.0, 1679.0]
[296, 296, 294]
p03364
u149260203
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
["import numpy as np\nfrom scipy.ndimage.interpolation import shift as scipy_shift\n\nclass shift:\n def __init__(self,a):\n self.arr = a\n self.height = a.shape[0]\n self.width = a.shape[1]\n def shifted(self,down,right):\n temp1 = self.arr[list(np.linspace(-down, -down + self.height ...
['Runtime Error', 'Accepted']
['s583868379', 's999809544']
[15716.0, 25388.0]
[204.0, 1829.0]
[1233, 1361]
p03364
u268793453
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['n = int(input())\ns = [input() for i in range(n)]\n\ncnt = 0\n\ndef is_symmetry():\n for k in range(n):\n for l in range(k+1, n):\n if s_[k][l] != s_[l][k]:\n return false\n return true\n\nfor i in range(n):\n i_ = (n+i)%n\n s_ = s[i_:] + s[:i_]\n if is_symmetry()\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s074004133', 's234382832', 's676878116', 's757005224', 's928637369', 's534724625']
[3064.0, 3188.0, 3064.0, 2940.0, 3064.0, 3316.0]
[17.0, 50.0, 23.0, 17.0, 24.0, 55.0]
[328, 256, 333, 344, 329, 290]
p03364
u350248178
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['import numpy as np\nn=int(input())\ns=np.array([list(input()) for i in range(n)])\nl=np.zeros((n,n),dtype=np.str)\nans=0\nfor i in range(n):\n l[:i]=s[n-i:n]\n l[i:]=s[:n-i]\n t=False\n for x in range(n):\n for y in range(x+1,n):\n if l[x][y]!=l[y][x]:\n t=True\n ...
['Time Limit Exceeded', 'Accepted']
['s700120967', 's909474042']
[15608.0, 14200.0]
[2112.0, 519.0]
[390, 192]
p03364
u547085427
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
["n = int(input())\nA = [input() for _ in range(n)]\nA_t = [''] * n\nfor c in A:\n for i in range(n):\n A_t[i] += c[i]\n\ndef checkTable(shift):\n for i in range(n):\n if A_t[i] != A[i][shift:] + A[i][:shift]:\n return False\n return True\n\ncount = 0\nfor i in range(n):\n if checkT...
['Wrong Answer', 'Accepted']
['s294962772', 's743283501']
[3188.0, 3188.0]
[69.0, 74.0]
[347, 361]
p03364
u561083515
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['\nimport numpy as np\n\ndef is_symmetric(a):\n \n return np.array_equal(a, a.T)\n\ndef main():\n N = int(input())\n S = [[ord(s) - ord("a") for s in list(input())] for _ in range(N)]\n\n S = np.array(S)\n\n ans = 0\n for B in range(N):\n if is_symmetric(np.roll(S, B, axis=1)):\n ...
['Wrong Answer', 'Accepted']
['s843822285', 's421745539']
[12476.0, 14552.0]
[148.0, 348.0]
[380, 419]
p03364
u600402037
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['import sys\nimport numpy as np\nimport copy\n\nstdin = sys.stdin\n \nri = lambda: int(rs())\nrl = lambda: list(map(int, stdin.readline().split()))\nrs = lambda: stdin.readline().rstrip() # ignore trailing spaces\n\n\nN = ri()\nS = [rs() for _ in range(N)]\nS = np.array(S + S)\nanswer = 0\nfor a in range(N):\n for...
['Wrong Answer', 'Accepted']
['s674083402', 's325510046']
[15736.0, 15856.0]
[2108.0, 518.0]
[611, 394]
p03364
u672220554
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['n = int(input())\ns = []\nfor _ in range(n):\n s.append(input())\n\ndef allequal(s):\n for i in range(n):\n for j in range(n):\n if s[i][j] != s[0][0]:\n return False\n return True\n\ndef val(s,k):\n global n\n for i in range(n):\n if i+k >= n:\n ni = ...
['Wrong Answer', 'Accepted']
['s978400182', 's007228893']
[3064.0, 3332.0]
[1616.0, 57.0]
[583, 432]
p03364
u790877102
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['N = int(input())\nS = []\nfor i in range(N):\n S.append(input())\n\ndef check(S, A, B):\n for i in range(N):\n for j in range(i+1, N):\n if S[i][j] != S[j][i]:\n return 0\n else return 1\n\ncnt = 0\nfor i in range(N):\n cnt += check(S[i:] + S[:i], 0, i)\nprint(cnt * N)\n',...
['Runtime Error', 'Runtime Error', 'Accepted']
['s798919390', 's901935770', 's791494078']
[2940.0, 3064.0, 3188.0]
[18.0, 18.0, 1629.0]
[300, 414, 283]
p03364
u814986259
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['N = int(input())\nS = [tuple(input()) for i in range(N)]\nans = 0\nfor A in range(N):\n for B in range(N):\n flag = True\n for i in range(N):\n for j in range(N):\n y = i + A\n x = j + B\n if y >= N:\n y -= N\n ...
['Wrong Answer', 'Accepted']
['s715167544', 's934225514']
[3828.0, 37808.0]
[2104.0, 638.0]
[595, 540]
p03364
u839188633
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['n = int(input())\ns = [input() for i in range(n)]\n\n\ndef check\n\ndef yoi(s, b):\n for i in range(n):\n for j in range(i+1, n):\n if s[i % n][(j + b) % n] != s[j % n][(i + b) % n]:\n return 0\n return 1\n\nsol = sum(yoi(s, b) for b in range(n))\nprint(sol * n)', 'n = int(input())\ns = [input() for ...
['Runtime Error', 'Accepted']
['s549508350', 's115434492']
[2940.0, 3316.0]
[17.0, 50.0]
[265, 300]
p03364
u846150137
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
["import numpy as np\nn=int(input())\ns=[chr(i) for i in range(97, 97+26)]\n \naa_cij=np.array([[s.index(i)+1 for i in list(input())] for _ in range(n)],dtype='int8')\n\nans=0\nfor i in range(n):\n aa_cij=np.concatenate( [ aa_cij[1:,:], aa_cij[[0],:] ], axis=0)\n if np.allclose(aa_cij 、aa_cij.T):\n ans+=1 \nprint...
['Runtime Error', 'Accepted']
['s791251604', 's621055403']
[2940.0, 21324.0]
[17.0, 978.0]
[317, 315]
p03364
u876442898
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['N = int(input())\nS = []\nfor i in range(N):\n S.append(input())\n\ndef check(A, B):\n for i in range(N):\n for j in range(i+1, N):\n if S[i][j] != S[j][i]:\n return 0\n return 1\n\ncnt = 0\nfor i in range(N):\n cnt += check(0, i)\nprint(cnt * N)', 'N = int(input())\nS = [...
['Wrong Answer', 'Runtime Error', 'Time Limit Exceeded', 'Runtime Error', 'Runtime Error', 'Accepted']
['s288975586', 's341091759', 's409068162', 's505267547', 's989201351', 's985974249']
[3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3188.0]
[1901.0, 24.0, 2104.0, 17.0, 18.0, 1612.0]
[276, 502, 506, 483, 302, 294]
p03364
u906501980
2,000
262,144
Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i-th row from the top and the j-th column from the left is called Square (i,j). There is a lowercase English letter written in each square on the first board. The letter written in Square (i,j) is S_{i...
['import numpy as np\nn = int(input())\nA = [[ord(i) for i in input()] for j in range(n)]\ncount = 0\nfor a in range(n):\n arr = np.roll(A, a, axis=0)\n arrT = arr.T\n for i in range(n):\n if arr[i][i:] != arrT[i][i:]:\n break\n else:\n count += n\nprint(count)', "n = int(input())\n...
['Runtime Error', 'Accepted']
['s066726113', 's489482161']
[14564.0, 3444.0]
[166.0, 563.0]
[284, 184]
p03365
u268793453
2,000
262,144
There are N squares lining up in a row, numbered 1 through N from left to right. Initially, all squares are white. We also have N-1 painting machines, numbered 1 through N-1. When operated, Machine i paints Square i and i+1 black. Snuke will operate these machines one by one. The order in which he operates them is rep...
['n = int(input())\np = 10**9 + 7\n\ndef fact(n, p):\n n_ = [1]\n for i in range(1, n+1):\n n_.append((n_[-1]*i) % p)\n return n\n\ndef invfact(n, f, p):\n m = [pow(f[n], p-2, p)]\n for i in range(n, 0, -1):\n m.append(m[-1] * i % p)\n return m\n\nans = 0\nm = n - 1\nf = list(fact(m, p)...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s189370144', 's622291094', 's697519173', 's780474361', 's710904544']
[42668.0, 42668.0, 42668.0, 84260.0, 82224.0]
[222.0, 222.0, 222.0, 943.0, 950.0]
[506, 759, 494, 511, 495]
p03365
u729707098
2,000
262,144
There are N squares lining up in a row, numbered 1 through N from left to right. Initially, all squares are white. We also have N-1 painting machines, numbered 1 through N-1. When operated, Machine i paints Square i and i+1 black. Snuke will operate these machines one by one. The order in which he operates them is rep...
['n = int(input())\nfn,fk,mod = [1]*n,[1]*n,10**9+7\nfor i in range(n-1): fn[i+1] = (fn[i]*(i+2))%mod\ndef power(n,k):\n\tif k==1: return n\n\telif k%2==0: return power((n**2)%mod,k//2)\n\telse: return (n*power(n,k-1))%mod\ndef comb(n,k):\n\tif n<k or k<0: return 0\n\telif k==0 or n==k: return 1\n\telse: return (((fn[n...
['Runtime Error', 'Accepted']
['s114976746', 's267935074']
[82164.0, 82164.0]
[813.0, 1467.0]
[527, 546]
p03373
u001024152
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
["# input -- A B C X Y\n\nA, B, C, X, Y = map(int, input().split())\nprint(A, B, C, X, Y )\n\n# can buy '2 * Z' pieces of C-pizza \nZ = min(X, Y)\nsum_of_pay = 0\n\nif A+B > 2*C:\n sum_of_pay += 2 * Z * C\n\n if X-Z > 0: \n if A > 2*C:\n sum_of_pay += 2 * (X-Z) * C\n else: \n s...
['Wrong Answer', 'Accepted']
['s949851225', 's977527189']
[3064.0, 3060.0]
[18.0, 18.0]
[540, 538]
p03373
u034128150
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a, b, c, x, y = map(int, input().split())\npossible_minimum_sum1 = a * x + b * y\npossible_minimum_sum2 = c * x * 2 + max(b-a, 0) * y\npossible_minimum_sum3 = c * y * 2 + max(a-b, 0) * x\n\nprint(min(possible_minimum_sum1, possible_minimum_sum2, possible_minimum_sum3))\n', 'a, b, c, x, y = map(int, input().split())\n...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s031723199', 's057430082', 's627451048', 's690966419']
[2940.0, 2940.0, 3060.0, 3060.0]
[18.0, 18.0, 17.0, 20.0]
[265, 174, 337, 265]
p03373
u062189367
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['import sys\nA, B, C, X, Y = map(int,input().split())\n\nmin = sys.maxsize\nX1 = X\nY1 = Y\n\n\nfor i in range(0, max(X,Y)+1):\n price = (X1-i)*A+(Y1-i)*B+2*i*C\n if min > price:\n min = price\n\n\nprint(min)\n', 'import sys\nA, B, C, X, Y = map(int,input().split())\n\nmin = sys.maxsize\nX1 = X\nY1 = Y\n\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s149582305', 's802443791', 's303657066']
[2940.0, 2940.0, 3060.0]
[65.0, 67.0, 98.0]
[207, 207, 225]
p03373
u064408584
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['n,c=map(int,input().split())\nx=[0]\nv=[]\nfor i in range(n):\n a,b=map(int,input().split())\n x.append(a)\n v.append(b)\nx1=[x[i+1]-x[i] for i in range(len(x)-1)]\nx2=[c-x[-1]]+x1[:0:-1]\n#print(x1,x2)\nh=[0]\nt=[0]\nfor i,j in zip(x2,reversed(v)):\n h.append(h[-1]+j+-i)\nhm=[max(h[:-i]) for i in range(1...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s040832332', 's873347726', 's885368573', 's562031548']
[3064.0, 3064.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0]
[451, 449, 130, 137]
p03373
u076245995
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = map(int, input().split())\nnot_in_C = A*X + B*Y\nif X > Y:\n cost = 2 * C * Y \n if A < C:\n cost += A * (X - Y)\n else:\n cost += 2 * C * (X - Y)\nelif X < Y\n cost = 2 * C * X\n if B < C:\n cost += B * (Y - X)\n else:\n cost += 2 * C * (Y - X)\nelif X == Y:\n cost = 2 * C * Y\npri...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s367048651', 's529343247', 's753692460', 's341176720']
[2940.0, 3060.0, 2940.0, 3060.0]
[17.0, 74.0, 17.0, 73.0]
[325, 279, 293, 283]
p03373
u101490607
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y = map(int, input().split() )\n\n#print(a,b,c,x,y)\n\ncost = a*x + b*y\n\nfor i in range( max(x,y) +1):\n tmp = i * 2*c + max(0, x-i)*a + max(0, x-i)*b\n if tmp < cost:\n cost = tmp\n \nprint( cost )', 'a,b,c,x,y = map(int, input().split() )\n\n#print(a,b,c,x,y)\n\ncost = a*x + b*y\n\nfor i in range(...
['Wrong Answer', 'Accepted']
['s101915486', 's026696041']
[3060.0, 3060.0]
[105.0, 105.0]
[205, 205]
p03373
u105302073
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = [int(i) for i in input().split()]\nis_x_large = X > Y\nif C < A // 2 and C < B // 2:\n if is_x_large:\n print(C * X * 2)\n else:\n print(C * Y * 2)\n exit()\n\ntotal1 = A * X + B * Y\nif is_x_large:\n total2 = C * Y * 2 + A * (X - Y)\nelse:\n total2 = C * X * 2 + B * (Y - ...
['Wrong Answer', 'Accepted']
['s996455364', 's674442353']
[3064.0, 3060.0]
[17.0, 17.0]
[375, 433]
p03373
u111202730
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a, b, c, x, y = map(int, input().split())\n\nans1 = a*x + b*y\n\nif x > y:\n ans2 = 2*c*y + a*(x-y)\n ans3 = 2*x*c\nelse:\n ans2 = 2*c*x + b*(y-x))\n ans3 = 2*c*y\n\nprint(min(ans1, ans2), ans3)\n', 'a, b, c, x, y = map(int, input().split())\n\nans1 = a*x + b*y\n\nif x >= y:\n ans2 = 2*c*y + a*(x-y)\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s343748445', 's521527759', 's331885425']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[196, 196, 200]
p03373
u140963344
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a=list(map(int, input().split()))\nb=2*a[3]*a[2]\nc=a[2]*a[4]*2+a[0]*(a[3]-a[4])\nd=2*a[4]*a[2]\ne=a[2]*a[3]*2+a[1]*(a[4]-a[3])\nf=a[0]*a[3]+a[1]*a[4]\ng=min(b,c,f)\nh=min(d,e,f)\nif a[3]>=a[4]:\n print(g)\nelse:\n print(h)\n', 'a, b, c, x, y=map(int, input().split())\nm=2*x*c\nn=c*y*2+a*(x-y)\nd=2*y*c\ne=c*x*2...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s035457721', 's098929030', 's177693862', 's283887866', 's293944506', 's302986497', 's377960766', 's486834913', 's543315995', 's560666514', 's678042010', 's751843800', 's847667896', 's889512550', 's943922139', 's993376928', 's047837268']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 3064.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 18.0, 18.0, 17.0, 18.0, 18.0, 17.0]
[243, 189, 195, 275, 275, 223, 242, 7, 279, 210, 43, 231, 243, 235, 225, 231, 165]
p03373
u161776322
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['\nA, B, C, X, Y = map(int, input().split())\n\nresult = []\n\nn = A*X + B*Y \nresult.append(n) \n\nn = C*min([X,Y])\nif X >= Y:\n n += (X-Y)*A \nelse:\n n += (Y-X)*B \nresult.append(n) \n\nn = C*max(X,Y)\nresult.append(n)\n\nprint(min(result))\n\n\n \n ', '\nA, B, C, X, Y = map(int, input().split())\n...
['Wrong Answer', 'Accepted']
['s241221360', 's012489977']
[3060.0, 3060.0]
[17.0, 17.0]
[247, 251]
p03373
u164898518
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = tuple(map(int, input().split()))\n\ndef money(A, B, C, X, Y):\n \n axby = A*X + B*Y\n if max([A, B, C]) == C:\n return axby\n \n cxy = C*max([X,Y])*2\n if X < Y:\n abcxy = C*X*2 + (Y-X)*B\n else:\n abcxy = C*Y*2 + (X-Y)*A\n \n print([axby, cxy, abcxy])\n...
['Wrong Answer', 'Accepted']
['s740937897', 's983572568']
[3064.0, 3064.0]
[17.0, 17.0]
[369, 339]
p03373
u179019249
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = map(int, input().split())\n\nmin_sum = A*X + B*Y\nfor c in range(0, 200000+2, 2):\n sum = C*c\n if X - c/2 > 0:\n sum += A * (X - c/2)\n if Y - c/2 > 0:\n sum += B * (Y - c/2)\n if sum < min_sum:\n min_sum = sum\nprint(min_sum)\n', 'A, B, C, X, Y = map(int, input().spl...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s120925818', 's228660615', 's280268611', 's355629357', 's419920369', 's528875848', 's534272913', 's853061477', 's904041577', 's965071020', 's504777308']
[3064.0, 3936.0, 3064.0, 3060.0, 3060.0, 3188.0, 4320.0, 3064.0, 2940.0, 3936.0, 3060.0]
[143.0, 224.0, 19.0, 147.0, 137.0, 267.0, 282.0, 146.0, 17.0, 224.0, 89.0]
[266, 274, 286, 260, 264, 260, 274, 264, 424, 279, 256]
p03373
u189397279
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['import sys\nA, B, C, X, Y = map(int, sys.stdin.readline().split(" "))\nans = float("inf")\n\nfor i in range(X + 1):\n for j in range(Y + 1):\n k = max(X - i, Y - i) * 2\n ans = min(ans, A * i + B * j + C * k)\nprint(ans)', 'import sys\nA, B, C, X, Y = map(int, sys.stdin.readline().split(" "))\nans = ...
['Wrong Answer', 'Accepted']
['s190209460', 's894794761']
[3060.0, 3064.0]
[2103.0, 173.0]
[229, 271]
p03373
u202560873
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
["A, B, C, X, Y = [int(x) for x in input().split()]\n\nnum_A = 0\nnum_B = 0\nnum_AB = 0\nif A + B <= 2 * C:\n num_A = X\n num_B = Y\nelse:\n Z = min(X, Y)\n X = X - Z\n Y = Y - Z\n num_AB = 2 * Z\n if A >= 2 * C:\n num_AB += 2 * X\n else: # A < 2 * C\n num_A = X\n if B >= 2 * C:...
['Wrong Answer', 'Accepted']
['s873687319', 's961030361']
[9152.0, 9144.0]
[26.0, 31.0]
[475, 436]
p03373
u213854484
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y = map(int,input().split())\np=5000000000\nfor i in list(range(0,max([X+1,Y+1]))):\n if p > max([X-i,0])*A+max([Y-i,0])*B+2*C*i:\n p=p\nprint(p)', 'A,B,C,X,Y = map(int,input().split())\np=5000000000\nfor i in list(range(0,max([X+1,Y+1]))):\n if p > max([X-i,0])*A+max([Y-i,0])*B+2*C*i:\n p...
['Wrong Answer', 'Accepted']
['s899638858', 's808447023']
[6900.0, 6900.0]
[120.0, 200.0]
[158, 192]
p03373
u224156735
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=map(int,input().split())\nans=a*x+b*y\nfor i in range(x+1):\n for j in range(y+1):\n if a*i+j*b+(x+y-i+j)*c<num:\n ans=a*i+j*b+(x+y-i+j)*c\nprint(ans) \n ', 'a,b,c,x,y=map(int,input().split())\n\n_1=a*x+b*y\n\nif x>=y:\n _2=c*2*y+(x-y)*a\n _3=2*x*c\nelse:\n _2=c*2*x+(y-x)*b\n _3 = 2*y*c...
['Runtime Error', 'Accepted']
['s432840400', 's330204057']
[2940.0, 3060.0]
[17.0, 17.0]
[174, 148]
p03373
u292735000
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a, b, c, x, y = map(int, input().split())\n\ncount_min = x * a + y * b\nfor p_a in range(x + 1):\n for p_b in range(y + 1):\n for p_ab in range(max(x, y) * 2 + 1):\n if p_a + 0.5 * p_ab == x and p_b + 0.5 * p_ab == y:\n count = p_a * a + p_b * b + p_ab * c\n if count...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s034934484', 's696436201', 's005581018']
[3064.0, 2940.0, 3060.0]
[2104.0, 18.0, 102.0]
[421, 162, 212]
p03373
u334792253
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,mix,n_a,n_b=input().rstrip().split()\na=int(a)\nb=int(b)\nmix=int(mix)\nn_a=int(n_a)\nn_b=int(n_b)\nfee=a*n_a+b*n_b\nif a+b<=2*mix:\n print(fee)\nelse:\n fee_mix=0\n if n_a>=n_b:\n fee_mix=n_b*mix+(n_a-n_b)*a\n else:\n fee_mix=n_a*mix+(n_b-n_a)*b\n print(fee_mix)', 'a,b,mix,n_a,n_b=in...
['Wrong Answer', 'Accepted']
['s345562434', 's548078721']
[3188.0, 3064.0]
[19.0, 18.0]
[281, 271]
p03373
u354527070
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a, b, c, x, y = map(int, input().split(" "))\nab = a * x + b * y\n\nabc = min(c * 2 * y + a * (x - y), c * 2 * x + b * (y - x))\n\ncc = c * 2 * max(x, y)\nprint(min(ab, abc, cc))', 'a, b, c, x, y = map(int, input().split(" "))\nprice = []\nfor i in range(0, x + 1):\n for j in range(0, y + 1):\n if x - i == ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s377485331', 's602788855', 's310941187']
[9104.0, 9116.0, 9192.0]
[28.0, 2205.0, 28.0]
[172, 291, 197]
p03373
u374103100
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['import sys\n\na, b, c, x, y = input().split(" ")\n\na = int(a)\nb = int(b)\nc = int(c)\nx = int(x)\ny = int(y)\n\n# print(a)\n# print(b)\n# print(c)\n# print(x)\n# print(y)\n#\n\nbest_price = sys.maxsize\n\nfor i in range(0, max(x + 1, y + 1) * 2 + 1, 2):\n rest_a = x\n rest_b = y\n\n if i // 2 >= x:\n ...
['Wrong Answer', 'Accepted']
['s405009019', 's023579132']
[4212.0, 3064.0]
[189.0, 108.0]
[685, 539]
p03373
u378157957
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['import math\n\n__DEUBG__ = 1\n\na, b, c, x, y = map(int, input().split())\n\nminimum = a * x + b * y\n\nif x > y:\n for i in range(x+1):\n N_a = i\n N_c = 2 * (x - i)\n if (y-N_c/2) < 0:\n N_b = 0\n else:\n N_b = y - int(N_c/2)\n tmp = a * N_a + b * N_b + c ...
['Wrong Answer', 'Accepted']
['s043768040', 's993361331']
[4296.0, 3064.0]
[195.0, 117.0]
[761, 771]
p03373
u382303205
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=map(int,input().split())\n\nprint(min(a*x+b*y, c*2*max(x,y)))', 'a,b,c,x,y=map(int,input().split())\n\nif x<y:\n x,y=y,x\n a,b=b,a\n\nprint(min(a*x+b*y, 2*c*x, 2*c*y-a*(x-y)))', 'a,b,c,x,y=map(int,input().split())\n\nif x<y:\n x,y=y,x\n a,b=b,a\n\nprint(min(a*x+b*y, 2*c*x, 2*c*y+a*(x-y)))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s616708366', 's937940257', 's491654684']
[3060.0, 3060.0, 3060.0]
[19.0, 17.0, 17.0]
[69, 110, 110]
p03373
u392029857
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = map(int, input().split())\nif X < Y:\n ab = range(Y + 1)\n p = X\nelse:\n ab = range(X + 1)\n p = Y\nmin_price = A*X+B*Y\nfor i in ab:\n if i <= p\n price = A*(X-i)+B*(Y-i)+(2*C*i)\n if min_price > price:\n min_price = price\n else:\n if p == X:\n ...
['Runtime Error', 'Accepted']
['s634971292', 's151070790']
[2940.0, 3064.0]
[18.0, 82.0]
[536, 545]
p03373
u416223629
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A,B,C,X,Y=map(int,input().split())\nprice=[]\nfor i in range(X+1):\n for j in range(Y+1):\n k=max(X-i,Y-j)*2\n price.append(A*i+B*j+C*k)\nprint(price)\nprint(min(price))', 'A,B,C,X,Y=map(int,input().split())\nprice=[]\nfor i in range(100000+1):\n price.append(i*2*C+max(0,X-i)*A+max(0,Y-i)*B)\n\npr...
['Wrong Answer', 'Accepted']
['s572720718', 's684638253']
[135980.0, 7096.0]
[2116.0, 104.0]
[179, 138]
p03373
u423966555
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y = map(int, input().split())\n\nans = 0\nif a+b < 2*c:\n if x <= y:\n ans += x*(a+b)\n if b < 2*c:\n ans += b*(y-x)\n else:\n ans += 2*c*(y-x)\n else:\n ans += y*(a+b)\n if a < 2*c:\n ans += a*(x-y)\n else:\n ans += 2...
['Wrong Answer', 'Accepted']
['s257283134', 's630049082']
[9088.0, 9064.0]
[29.0, 29.0]
[491, 576]
p03373
u501643136
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['A, B, C, X, Y = map(int,inut().split())\nif(A + B >= 2 * C):\n if(X >= Y):\n print(C * 2 * Y + (X - Y) * min(A, 2 * C))\n else :\n print(C * 2 * X + (Y - X) * min(B, 2 * C))\nelse:\n print(A * X + B * Y)', 'A, B, C, X, Y = map(int,input().split())\nif(A + B >= 2 * C):\n if(X >= Y):\n print(C * 2 * Y + (X...
['Runtime Error', 'Accepted']
['s295322872', 's507270869']
[3064.0, 3060.0]
[17.0, 18.0]
[205, 206]
p03373
u503181529
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['\nA, B, C, X, Y = [int(x) for x in input().split()]\n\n\ndef r(a, b, c, x, y):\n print(a, b, c, x, y)\n if x == 0 and y == 0:\n return 0\n if x == 0:\n return min(y*b, 2*y*c)\n if y == 0:\n return min(x*a, 2*x*c)\n if (a + b) / 2 < c:\n return a*x+b*y\n else:\n z =...
['Wrong Answer', 'Accepted']
['s217836653', 's706738018']
[3064.0, 3064.0]
[18.0, 20.0]
[426, 399]
p03373
u508405635
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['import sys\nA, B, C, X, Y = map(int,input().split())\n \nminf = sys.maxsize\nX1 = X\nY1 = Y\n \n \nfor i in range(0, max(X,Y)+1):\n price = max(0,(X1-i))*A+max(0,(Y1-i))*B+2*i*C\n \n \nprint(min(price))', 'import sys\nA, B, C, X, Y = map(int,input().split())\n \nminf = sys.maxsize\nX1 = X\nY1 = Y\n \nfor i in rang...
['Runtime Error', 'Runtime Error', 'Accepted']
['s442540939', 's602191524', 's585241637']
[3064.0, 3060.0, 7096.0]
[94.0, 93.0, 103.0]
[193, 188, 478]
p03373
u509739538
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a,b,c,x,y=readInts()\nfor i in range(max(x,y)*2+1,2):\n\tans=min(ans,max(x-i//2,0)*a+max(y-i//2,0)*b+i*c)\nprint(ans)\n\n', 'import math\nimport queue\nfrom collections import defaultdict\n \ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn in...
['Runtime Error', 'Accepted']
['s806075200', 's228199161']
[2940.0, 4080.0]
[18.0, 138.0]
[115, 2289]
p03373
u514383727
2,000
262,144
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the curr...
['a, b, c, x, y = list(map(int, input().split()))\n\na_sum = a * x\nb_sum = b * y\nc_sum = c * (x+y)\nprice = 0\n\nif a_sum + b_sum > c_sum:\n num = min(x, y)\n price += num * c * 2\n x -= num\n y -= num\n print(price)\n if x > 0:\n if a < c * 2:\n price += a * x\n else:\n ...
['Wrong Answer', 'Accepted']
['s975624407', 's504681621']
[3064.0, 3064.0]
[17.0, 18.0]
[478, 460]