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
p02701
u830162518
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N=int(input())\nS=[input() for i in range (N)]\nL=list(S)\nsorted(L)\nprint(len(L)+1)', 'N=int(input())\nL=[input() for i range(N)]\nM=sorted(L)\nprint(len(M))', 'N=int(input())\nL=[input() for i in range(n)]\nM=set(L)\nprint(len(M))', 'N=int(input())\nL=[input() for i in range(N)]\nM=set(L)\nprint(len(M))\n']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s159697949', 's277641967', 's744992340', 's617088755']
[27088.0, 8912.0, 9172.0, 35588.0]
[284.0, 20.0, 24.0, 263.0]
[81, 67, 67, 68]
p02701
u834983620
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['a = int(input())\naaa = list([input(i)for i in range(a)])\n\nans = len(set(aaa))\n\nprint(ans)', 'a = int(input())\naaa = set([input()for i in range(a)])\n\nbbb = list(set(aaa))\n\nans = len(bbb)\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s427867273', 's342424863']
[36184.0, 39436.0]
[609.0, 290.0]
[89, 104]
p02701
u842901156
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['from collections import Counter\nN = int(input())\ns = [input() for i in range(N)]\nprint(len(s))', 'from collections import Counter\nN = int(input())\ns = [input() for i in range(N)]\nc = collections.Counter(s)\nprint(len(c))', 'N = int(input())\ns = [input() for i in range(N)] \nc = collections.Counter(s)\nprint(le...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s140925902', 's424120558', 's634455521', 's911665681', 's297965079']
[23616.0, 23536.0, 23212.0, 23252.0, 38900.0]
[231.0, 229.0, 229.0, 227.0, 261.0]
[94, 121, 127, 122, 109]
p02701
u845847173
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['from collections import Counter\n\nn = int(input())\ns = [str(e) for e in input().split()]\nprint(len(Counter(s)))', 'from collections import Counter\n\nn = int(input())\ns = []\nfor _ in range(n):\n s.append(input())\nprint(len(Counter(s)))']
['Wrong Answer', 'Accepted']
['s989375439', 's302349645']
[9472.0, 38900.0]
[23.0, 282.0]
[110, 120]
p02701
u847692421
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS = []\nfor i in range(1, N+1):\n S_i = input()\n S.append(S_i)\ncnt = 0\nfor i in range(0, N):\n flg = 0\n for j in range(i+1, N):\n if( S[i] == S[j]):\n break\n if(flg ==0):\n cnt += 1\nprint(cnt)', 'N = int(in...
['Wrong Answer', 'Accepted']
['s147097289', 's725375947']
[23444.0, 35360.0]
[2206.0, 279.0]
[291, 116]
p02701
u848535504
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS = [int(input()) for i in range(N)]\n\nprint(len(set(S)))', 'N = int(input())\nS = [input() for i in range(N)]\n\nprint(len(set(S)))']
['Runtime Error', 'Accepted']
['s607407262', 's194451921']
[9120.0, 35632.0]
[24.0, 258.0]
[73, 68]
p02701
u848647227
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['a = int(input())\nar = []\nfor i in range(a):\n ar.append(l)\nprint(len(set(ar)))', 'a = int(input())\nar = []\nfor i in range(a):\n l = input()\n ar.append(l)\nprint(len(set(ar)))']
['Runtime Error', 'Accepted']
['s915178433', 's644660123']
[9104.0, 35508.0]
[22.0, 275.0]
[80, 96]
p02701
u850087201
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['import numpy as np\nN = int(input())\nl = []\nfor i in range(N):\n l.append(input())\nk = np.array(l)\nans = 0\nfor i in range(N):\n a = 0\n if k[np.argsort(k)[i]]!=a:\n ans+= 1\n a = k[np.argsort(k)[i]]', 'N = int(input())\nl = []\nfor i in range(N):\n l.append(input())\nk = sorted(l)\nans ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s184168061', 's580478528', 's842827367', 's789387567']
[59964.0, 25460.0, 25296.0, 25596.0]
[2207.0, 349.0, 359.0, 362.0]
[215, 175, 175, 171]
p02701
u850479192
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['\ni = int(input())\nlists = []\nfor j in range(i):\n lists.insert(j, str(input()))\n\nprint(lists)\nprint(len(set(lists)))\n', 'i = int(input())\nlists = []\nfor j in range(i):\n lists.insert(j, str(input()))\n\nprint(lists)\nprint(len(set(lists)))', 'i = int(input())\nlists = []\nfor j in range(i):\n lists....
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s136830669', 's857236443', 's927356404', 's870801770']
[37900.0, 38084.0, 38032.0, 35580.0]
[318.0, 321.0, 321.0, 277.0]
[154, 117, 118, 116]
p02701
u855831834
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nans = {}\nfor i in range(N):\n t = input()\n if t not in ans:\n ans[t] = 1\nprint(len(ans.keys())', 'N = int(input())\nans = {}\nfor i in range(N):\n t = input()\n if t not in ans:\n ans[t] = 1\nprint(len(ans.keys()))\n']
['Runtime Error', 'Accepted']
['s731483802', 's532530813']
[8908.0, 35292.0]
[20.0, 280.0]
[114, 116]
p02701
u857673087
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS =[input() for i in range(N+1)]\n\ns = set(S)\n\nprint(len(s))', 'N = int(input())\nS =[input() for i in range(N)]\n\ns = set(S)\n\nprint(len(s))']
['Runtime Error', 'Accepted']
['s751695314', 's734888076']
[23352.0, 35640.0]
[224.0, 270.0]
[76, 74]
p02701
u862920361
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['mport collections\nS=[]\nN=int(input())\nfor i in range(N):\n S.append(input())\nprint(len(collections.Counter(S)))\n \n\n \n\n', 'import collections\nS=[]\nN=int(input())\nfor i in range(N):\n S.append(input())\nprint(len(collections.Counter(S)))\n ']
['Runtime Error', 'Accepted']
['s802370161', 's007942651']
[9012.0, 38920.0]
[23.0, 280.0]
[126, 119]
p02701
u863433366
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\ns = [input() for _ in range(n)]\nans = [[] for _ in range(n)]\n\nfor i in range(n):\n ans[i] = s[i]\n\nprint(len(ans))', 'n = int(input())\ns = [input() for _ in range(n)]\nans = [[] for _ in range(n)]\n\nfor i in range(n):\n ans[i] = s[i]\n\nANS = set(ans)\nprint(len(ANS))']
['Wrong Answer', 'Accepted']
['s866280338', 's390967789']
[37460.0, 37388.0]
[292.0, 326.0]
[130, 148]
p02701
u863955163
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS = [input() for i in range(N)]\na = set(S)\nprint(len(a)', 'N = int(input())\nS = [input() for i in range(N)]\na = set(S)\nprint(len(a))']
['Runtime Error', 'Accepted']
['s034901130', 's352115960']
[8896.0, 35584.0]
[22.0, 268.0]
[72, 73]
p02701
u865728927
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\nli = list()\nfor i range(n):\n\tli.append(str(input()))\n\nprint(len(set(li)))\n\n', 'n = int(input())\nli = list()\nfor i in range(n):\n\tli.append(str(input()))\n\nprint(len(set(li)))\n\n']
['Runtime Error', 'Accepted']
['s363517880', 's707802758']
[8948.0, 35572.0]
[23.0, 293.0]
[92, 95]
p02701
u866700524
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['M = int(input())\nP = [input().split() for i in range(M)]\nprint(len(set(P)))', 'M = int(input())\nP = [input() for i in range(M)]\nprint(len(set(P)))']
['Runtime Error', 'Accepted']
['s878950710', 's960333937']
[55068.0, 35572.0]
[326.0, 252.0]
[75, 67]
p02701
u875049118
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N=input()\nS = [str(input()) for i in range(N)]\nprint(len(set(S)))', 'S=[str(input()) for i in range(2*10^5-1)]\nS.pop(0)\nprint(len(set(S)))', 'S=[str(input()) for i in range(2*10^1-1)]\nS.pop(0)\nprint(len(set(S))', "S = [str(input()) for i in range(2*10^5)]\n#(2*10^5): \nS.pop(0)\nif '' in S:\n print(len(se...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s219441774', 's861656540', 's931226814', 's934309671', 's123835620']
[9096.0, 9096.0, 9016.0, 9116.0, 35728.0]
[22.0, 22.0, 23.0, 24.0, 277.0]
[65, 69, 68, 131, 70]
p02701
u878291720
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS = set()\nfor i in range(N):\n S.add(i)\nprint(len(S))', 'N = int(input())\nS = set()\nfor i in range(N):\n S.add(input())\nprint(len(S))']
['Wrong Answer', 'Accepted']
['s259957736', 's328353937']
[26232.0, 31040.0]
[52.0, 288.0]
[70, 76]
p02701
u883218362
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['# C - gacha\n\nn = int(input())\ns = []\nc = 0\n\nfor i in range(n):\n s.append(input())\n\ns.sort()\n\nfor j in range(n-1):\n if s[j] != s[j+1]:\n c += 1\n\n\nprint(c)\n', '# C - gacha\n\nn = int(input())\ns = []\nc = 1\n\nfor i in range(n):\n s.append(input())\n\ns.sort()\n\nfor j in range(1,n):\n ...
['Wrong Answer', 'Accepted']
['s400001689', 's376075235']
[23776.0, 23788.0]
[350.0, 337.0]
[166, 166]
p02701
u884601206
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\na=list(map(int,input().split()))\na=set(a)\nprint(len(a))\n', 'n=int(input())\na=[0]*n\nfor i in range(n):\n a[i]=input()\n \na=set(a)\nprint(len(a))\n\n']
['Runtime Error', 'Accepted']
['s656787862', 's239182324']
[9168.0, 35544.0]
[22.0, 276.0]
[71, 84]
p02701
u891202624
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N=int(input())\nS=[]\ncount++\nfor i in range(N):\n A=input()\n if A not in S:\n S.append(A)\n count+=1\nprint(count)', 'N=int(input())\nS=[]\nfor i in range(N):\n A=input()\n S.append(A)\nprint(len(set(S)))']
['Runtime Error', 'Accepted']
['s543813442', 's413062097']
[8932.0, 35552.0]
[27.0, 276.0]
[129, 87]
p02701
u892882715
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\n\nitems = [input() for _ in range(N)]\n\nd = {}\nfor item in items:\n if item not in d:\n d[item] = True\n print(item)\n \n', 'N = int(input())\n\nd = {}\n\nfor _ in range(N):\n s = input()\n if s not in d:\n print(s)\n d[s] = 1\n \n', 'N = int(input())\n\ns = set(input() for _ in r...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s684444515', 's770763463', 's619501126']
[38512.0, 35400.0, 30960.0]
[341.0, 700.0, 270.0]
[139, 105, 75]
p02701
u904081717
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = input()\nstr_list = [input() for _ in range(N)]\n\nprint(len(set(str_list)))', 'N = int(input())\nstr_list = [input() for _ in range(N)]\n\nprint(len(set(str_list)))\n']
['Runtime Error', 'Accepted']
['s629129832', 's078787239']
[9048.0, 35724.0]
[21.0, 258.0]
[77, 83]
p02701
u906024886
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['A=map(int,input().split())\nlist = []\nfor n in range(A):\n\tcon = str(input())\n\tif con not in list:\n\t\tlist.append(con)\n\telse: pass\nprint(str(len(list)))\n', 'n = int(input())\ns = set(input() for _ in range(n))\nprint(len(s))']
['Runtime Error', 'Accepted']
['s519962584', 's954067025']
[9096.0, 30984.0]
[23.0, 261.0]
[150, 65]
p02701
u907223098
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\nr=0\nl=[]\nfor i in range(n):\n l.append(input())\nl.sort()\nfor i in range(n-1):\n if l[i]!=l[i+1]:\n r+=1\n \nprint(r)\n', 'n=int(input())\nr=1\nl=[]\nfor i in range(n):\n l.append(input())\nl.sort()\nfor i in range(n-1):\n if l[i]!=l[i+1]:\n r+=1\n \nprint(r)\n']
['Wrong Answer', 'Accepted']
['s839409109', 's088087249']
[23952.0, 23960.0]
[340.0, 349.0]
[133, 133]
p02701
u907566687
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\n\narr = []\n\nfor i in range(N):\n arr.append(input())\n\nprint(len(set(arr))', 'N = int(input())\n\narr = []\n\nfor i in range(N):\n arr.append(input())\n\nprint(len(arr.set()))', 'N = int(input())\n\narr = []\n\nfor i in range(N):\n arr.append(input())\n\nprint(len(set(arr)))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s216908895', 's330270683', 's749969586']
[9028.0, 23268.0, 35524.0]
[23.0, 243.0, 260.0]
[91, 93, 92]
p02701
u912867658
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\nal = []\ncount = 1\nfor i in range(n):\n a = input()\n if a\u3000in al:\n count += 1\n else:\n al.append(a)\nprint(count)', 's = set(open(0))\nprint(len(s)-1)\n']
['Runtime Error', 'Accepted']
['s895798855', 's179855816']
[8960.0, 30948.0]
[20.0, 75.0]
[136, 33]
p02701
u919065552
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nL = []\nif not (1 <= N <= 2*(10**5)):\n exit()\n\n\nfor i in range(N):\n d = input()\n if not (1 <= len(d) <= 10):\n exit()\n if not (d.lower() == d):\n exit()\n L.append(d)\n\nprint(len(set(L)))\nroot@stypr-ubuntu:~/1# ', 'N = int(input())\nL = []\nif not (1 <= N <= 2*(...
['Runtime Error', 'Accepted']
['s493418883', 's988003712']
[9080.0, 35564.0]
[23.0, 277.0]
[252, 235]
p02701
u926517746
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\n# N = 3\n\nitems = []\n\nfor i in range(0, N) :\n newItem = str(input())\n # newItem = str("apple")\n\n if newItem not in items :\n items.append(newItem)\n\nlen(items)', 'N = int(input())\n# N = 3\n\nitems = set()\n\nfor i in range(0, N) :\n items.add(str(input()))\n # items.ad...
['Wrong Answer', 'Accepted']
['s203471610', 's060643460']
[10160.0, 31116.0]
[2206.0, 317.0]
[189, 185]
p02701
u928347588
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\nls = []\ncount = 0\nfor x in range(n):\n ls.append(input())\nset(ls)\nprint(len(ls))', 'n = int(input())\nls = []\ncount = 0\nfor x in range(n):\n ls.append(input())\nls = set(ls)\nprint(len(ls))']
['Wrong Answer', 'Accepted']
['s398372123', 's315312977']
[35592.0, 35588.0]
[274.0, 279.0]
[99, 104]
p02701
u931636178
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input)\nans = []\nfor _ in range(N):\n s = input()\n ans.append(s)\nprint(len(list(set(ans)))', 'N = int(input())\nans = []\nfor _ in range(N):\n s = input()\n ans.append(s)\nprint(len(list(set(ans))))']
['Runtime Error', 'Accepted']
['s351044868', 's310524862']
[8968.0, 35656.0]
[20.0, 283.0]
[98, 101]
p02701
u932868243
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\nlists=[input() for x in range(n)]\nlistget=[]\nfor s in lists:\n for y in range(1,n+1):\n listget.append(s[y])\nprint(len(set(listget))\n \n ', 'n=int(input())\nlists=[input() for x in range(n)]\nprint(len(set(lists))', 'n=int(input())\ns=[input() for _ in range(n)]\nprint(len(set(s...
['Runtime Error', 'Runtime Error', 'Accepted']
['s959169351', 's963524186', 's720179872']
[9032.0, 8972.0, 35580.0]
[22.0, 22.0, 257.0]
[168, 70, 63]
p02701
u935089856
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\na = []\n\nfor i in range(N):\n a.append(input())\n \nb = set(a)\nprint(len(a))', 'N = int(input())\na = []\n\nfor i in range(N):\n a.append(input())\n \nb = set(a)\nprint(len(b))']
['Wrong Answer', 'Accepted']
['s743897659', 's265166869']
[35708.0, 35588.0]
[281.0, 287.0]
[91, 91]
p02701
u938718404
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\nli=[]\nfor si in n:\n si=input()\n li.append(si)\nprint(len(set(li)))', 'n=int(input())\nli=[]\nfor si in range(n):\n si=input()\n li.append(si)\nprint(len(set(li)))']
['Runtime Error', 'Accepted']
['s580509455', 's800224945']
[9144.0, 35596.0]
[22.0, 275.0]
[86, 93]
p02701
u940592576
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\nobj= []\nfor i in range (n):\n\tobj.append(input())\ndictOfElems = dict()\nfor elem in obj:\n if elem in dictOfElems:\n dictOfElems[elem] += 1\n else:\n dictOfElems[elem] = 1\nprint(len(dict))', 'n = int(input())\nobj= []\nfor i in range (n)\n\tobj.append(input())\ndictOfElems = dict()\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s173469825', 's239641936', 's415549792', 's127306244']
[38204.0, 9004.0, 9020.0, 38328.0]
[292.0, 22.0, 25.0, 296.0]
[207, 360, 360, 214]
p02701
u942356554
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\nList = [input() for i in range(n)]\nset(List)\nprint(len(List))', 'n=int(input())\nList = [input() for i in range(n)]\nd=set(List)\nprint(len(d))']
['Wrong Answer', 'Accepted']
['s364087931', 's476260904']
[35636.0, 35636.0]
[251.0, 262.0]
[76, 75]
p02701
u944886577
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\nlst={}\n for i in range(n):\n lst[str(input())]+=1\nprint(len(lst))', 'n=int(input())\nlst=[]\nfor i in range(n)\n lst.extend(str(input()))\n \n \nlist_uniq=[]\nfor j in lst\n if list_uniq.count(j)==0:\n list_uniq.extend(j)\n else:\n pass\n print(len(list_uniq))', 'n=int(input())\nlst={}\nfor...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s253304351', 's284035200', 's562105192', 's906811678', 's180896129']
[8860.0, 8936.0, 9148.0, 8988.0, 35284.0]
[24.0, 25.0, 24.0, 25.0, 272.0]
[82, 185, 191, 186, 73]
p02701
u945200821
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['import sys\nfrom collections import Counter\n\n\ndef main():\n scan = sys.stdin.readline\n \n n = int(scan().rstrip())\n s = scan().rstrip().split()\n \n print(len(Counter(s)))\n\n\nif __name__ == "__main__":\n main()\n', 'import sys\nfrom collections import Counter\n\n\ndef main():\n scan = sys.stdin.readlin...
['Wrong Answer', 'Accepted']
['s324833675', 's430971136']
[9464.0, 38924.0]
[23.0, 102.0]
[211, 223]
p02701
u949442192
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nL = [input()]\n\nfor _ in range(N-1):\n a = input()\n imin = 0\n imax = len(L)-1\n l = 0\n\n while (imin<imax):\n l = (imin+imax)//2\n if (a==L[l]):\n break\n elif (a>L[l]):\n imin = min(l+1,len(L)-1)\n else:\n imax = max(l-...
['Runtime Error', 'Runtime Error', 'Accepted']
['s107395506', 's656688204', 's007914495']
[8876.0, 9008.0, 35528.0]
[20.0, 23.0, 267.0]
[462, 926, 67]
p02701
u957098479
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS = list(map(str,input().split()))\n\nT = list(set(S))\nprint(len(T))', 'N = int(input())\nS = [input() for i in range(N)]\nT = list(set(S))\nprint(len(T))']
['Wrong Answer', 'Accepted']
['s663727015', 's381721104']
[8864.0, 35520.0]
[23.0, 267.0]
[83, 79]
p02701
u974231963
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['\ns = int(input()) \ns_list = [input() for _ in range(s)]\nprint(s_list) \n\nans = 0\n\ns_list = set(s_list)\n\nprint(len(s_list))', '\ns = int(input()) \ns_list = [input() for _ in range(s)]\n\n\nans = 0\n\ns_list = set(s_list)\n\nprint(len(s_list))']
['Wrong Answer', 'Accepted']
['s250303404', 's544567364']
[38120.0, 35712.0]
[284.0, 276.0]
[158, 160]
p02701
u974918235
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\ngacha = set()\nfor _ in range(N):\n gacha.append(input())\nprint(len(gacha))', 'N = int(input())\ngacha = set()\nfor _ in range(N):\n gacha.add(input())\nprint(len(gacha))']
['Runtime Error', 'Accepted']
['s622943534', 's104059128']
[9160.0, 31020.0]
[25.0, 286.0]
[91, 88]
p02701
u976282379
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\nS = []\nwhile True:\n Si = input()\n if Si:\n S.append(Si)\n else:\n break\ng = S[: N]\nprint(g)\n', 'c = input().split("\\n")\nN = int(c[0])\nS = c[1:]\nprint(len(set(S[:N])))\n', 'n = int(input())\ns = set(input() for _ in range(n))\nprint(len(s))\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s240465038', 's782717117', 's898838167']
[23404.0, 9100.0, 31008.0]
[245.0, 22.0, 275.0]
[129, 71, 66]
p02701
u984989720
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\na = [input() for i in range(n)]\n\nc = collections.counter(a)\n\nprint(len(c))', 'n = int(input())\na = [input().split() for i in range(n)]\n\nc = collections.counter(a)\n\nprint(len(c))\n', 'import collections\nn = int(input())\na = [input() for i in range(n)]\nlist_a = list(a)\nc = collections.Cou...
['Runtime Error', 'Runtime Error', 'Accepted']
['s470846940', 's990635087', 's850172798']
[23084.0, 55052.0, 40484.0]
[227.0, 340.0, 276.0]
[91, 100, 127]
p02701
u988661952
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['import collections\n\nN=int(input())\nlist=[input() for i in range(N)]\n\nc= collections.Counter(list)\n\nm=0\nfor i in c.values():\n m+=i\n\nprint(m)', 'import collections\n\nN=int(input())\nlist=[input() for i in range(N)]\n\nc= collections.Counter(list)\n\nm=0\nfor i in c.values():\n m+=1\n\nprint(m)']
['Wrong Answer', 'Accepted']
['s785742218', 's205054598']
[38708.0, 38920.0]
[282.0, 279.0]
[142, 142]
p02701
u990148524
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n = int(input())\n\nl = list()\nfor num in range (1,n+1):\n l.append(input())\n\nanswer = [x for x in set(l) if l.count(x) > 1]\nprint(len(answer))', 'n = int(input())\n\nl = list()\nfor num in range (1,n+1):\n l.append(input())\n\nprint(len(set(l)))\n']
['Wrong Answer', 'Accepted']
['s323780621', 's811116097']
[35572.0, 35716.0]
[2206.0, 276.0]
[143, 97]
p02701
u992471673
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['n=int(input())\n\ns=input().split()\n\nans=[0 for i in range(n)]\nfor i in range(0,n-1):\n s[i]=int(s[i])\n ans[s[i]-1]+=1\n\nfor i in range(0,n):\n print(ans[i])\n\n\n', 'n=int(input())\n\ns=[0]*n\n\nfor i in range(0,n):\n s[i]=input()\n\n\ns_set=set(s)\nans=len(s_set)\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s921036481', 's528545509']
[10464.0, 35620.0]
[27.0, 276.0]
[164, 104]
p02701
u997927785
2,000
1,048,576
You drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i. How many kinds of items did you get?
['N = int(input())\n\nkeihin = []\n\n\nfor i in range(N):\n if keihin.count(input()) == 0:\n keihin.append(input())\n\n\nprint(len(keihin))\n', 'N = int(input())\nS = [str(input()) for _ in range(N)]\n\nS.sort()\n\ncount = 1\n\nfor i in range(N-1):\n if S[i] != S[i+1]:\n count += 1\n\nprint(count)']
['Runtime Error', 'Accepted']
['s571718139', 's862868171']
[10160.0, 23820.0]
[2206.0, 350.0]
[198, 152]
p02702
u002625175
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['from collections import defaultdict\n\ndef main():\n s = input()\n n = len(s)\n\n mod = 2019\n\n counts = [0] * mod\n\n prev = int(s[-1])\n counts[prev] += 1\n for i in range(2, n + 1):\n t = prev + int(s[-i]) * 10 ** (i - 1)\n counts[t % mod] += 1\n prev = t\n\n ans = 0\n for count in counts:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s239248712', 's402543377', 's452153633', 's062854229']
[9572.0, 9536.0, 31668.0, 10960.0]
[2206.0, 2206.0, 2262.0, 81.0]
[373, 353, 386, 327]
p02702
u014958112
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()\ncounts = [0] * 2019\ncounts[0] = 1\nresult = 0\n\nfor i in range(len(s)):\n mod2019 = int(s[-i:]) % 2019\n print("mod2019={}".format(mod2019))\n counts[mod2019] += 1\n\nfor cnt in counts:\n result += cnt*(cnt-1)//2\n \nprint(result)\n ', 's = input()[::-1]\ncounts = [0] * 2019\ncounts[0...
['Wrong Answer', 'Accepted']
['s053888748', 's084698169']
[9324.0, 9284.0]
[2206.0, 111.0]
[252, 251]
p02702
u015593272
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["def main():\n import sys\n S = sys.stdin.readline()[:-1]\n\n S = input()\n int_S = int(S)\n N = len(S)\n cnt = 0\n pos_l = 0\n pos_r = 0\n\n\n while (True):\n pos_r += + 1\n \n if (pos_r < N):\n tmp = int(S[pos_l: pos_r + 1])\n if (tmp % 2019 == 0...
['Runtime Error', 'Accepted']
['s702740088', 's587733875']
[9052.0, 16760.0]
[23.0, 331.0]
[503, 507]
p02702
u017415492
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['P=2019\nS = input()\nN=len(S)\n\nans = 0\ncount = [0] * P\ncount[0] = 1\nu = 0\nfor i, s in enumerate(reversed(S)):\n print(i,s)\n u = (int(s) * pow(10, i, P) + u) % P\n ans += count[u]\n count[u] += 1\n\nprint(ans)', 'P=2019\nS = input()\nN=len(S)\ncount=[0]*P\nans = 0\ncount[0] = 1\nu = 0\nfor i, s in enumerate...
['Wrong Answer', 'Accepted']
['s849709398', 's268508449']
[9220.0, 9256.0]
[434.0, 340.0]
[205, 188]
p02702
u021019433
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['d = {0: 1}\ns, p = 0, 1\nfor c in reversed(input()):\n s = (s + p * int(c)) % 2019\n d[s] = d.get(s, 0) + 1\n p = p * 10 % 2019\nprint(sum(x * (x - 1) // 2 for x in d))\n', 'from collections import defaultdict\n\nd = defaultdict(int)\nd[0] = 1\ns, p = 0, 1\nfor c in reversed(input()):\n s = (s + p * int(c)) % 201...
['Wrong Answer', 'Accepted']
['s195264966', 's170793442']
[9348.0, 9568.0]
[118.0, 124.0]
[166, 231]
p02702
u022843632
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['from functools import reduce\n\nn = int(input()) \nl = [int(x) for x in list(str(n))]\n\nnum=len(l)\ncount=0\nsum=0\nfor i in range(num-3): \n for j in range(3,num):\n if i>=j or j-i<3:\n pass\n else:\n for x in l[i:j+1]:\n sum=sum+x\n if sum%3==0:\n ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s418170727', 's550170516', 's855854982', 's298296567']
[12656.0, 9208.0, 9064.0, 9332.0]
[2206.0, 20.0, 22.0, 115.0]
[487, 196, 195, 198]
p02702
u028014940
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['\ns=list(input())[::-1] \nn=len(s)\namari_lis=[0]*2019 # \namari_lis[0]=1 \n\nnum=0\nkurai=1\nfor keta in s:\n num+=int(keta)*kurai\n num%=2019\n amari_lis[num]+=1\n kurai*=10\n kurai%=2019 \n\nans=0\nfor i in amari_lis:\n ans+=i*(i-1)/2 \n\nprint(ans)', 's=list(input())[::-1] \nn=len(s)\namari_lis=...
['Wrong Answer', 'Accepted']
['s562847810', 's720865349']
[11896.0, 11892.0]
[115.0, 121.0]
[634, 638]
p02702
u029000441
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["\nimport sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10**7)\nfrom collections import Counter, deque\nfrom collections import defaultdict\nfrom itertools import combinations, permutations, accumulate, groupby, product\nfrom bisect import bisect_left,bisect_right\nfrom heapq import heapify, heappop, heappush...
['Wrong Answer', 'Accepted']
['s108860973', 's150078301']
[24116.0, 24076.0]
[200.0, 196.0]
[1114, 1234]
p02702
u036104576
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import sys\nimport itertools\n# import numpy as np\nimport time\nimport math\n\nsys.setrecursionlimit(10 ** 7)\n\nfrom collections import defaultdict\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn = readline().decode()\nn = list(reversed(n))\n\nx = 1...
['Runtime Error', 'Runtime Error', 'Accepted']
['s736894207', 's771725822', 's970421546']
[10876.0, 10832.0, 9640.0]
[27.0, 28.0, 141.0]
[513, 513, 494]
p02702
u054825571
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S=input()\nans=0\nN=len(S)\nfor i in range(N-2):\n s=S[i:i+3]\n for j in range(i+3,N):\n s+=S[j]\n print(s)\n if int(s)%2019==0:\n ans+=1\nprint(ans)', 'S=input()\nans,n=0,len(S)\ndp=[0]*(2019)\ns,dp[0],k=0,1,1\nfor i in S[::-1]:\n s=(s+int(i)*k)%2019\n k=(k*10)%2019\n ans+=dp[s]\n dp[s]+=1\nprint...
['Wrong Answer', 'Accepted']
['s729541559', 's662168952']
[63232.0, 9316.0]
[2306.0, 119.0]
[155, 145]
p02702
u060736237
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['def main():\n S = input()\n work, temp = [0] * 2019, 0\n work[0] = 1\n a = 1\n for s in S:\n temp += int(s) * a\n work[temp%2019] += 1\n a *= 10\n a %= 2019\n print(sum([w*(w-1)//2 for w in work]))\nmain()', 'def main():\n S = input()\n N = len(S)\n S = int(S)\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s491490367', 's532032622', 's918194260']
[9296.0, 9344.0, 9408.0]
[80.0, 205.0, 82.0]
[240, 196, 246]
p02702
u067077296
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()\nn = len(s)\ncnt = 0\nfor i in range(n-2):\n for j in range(i+3, n+1):\n if int(s[i:j]) % 2019 == 0:\n print(i, j)\n cnt += 1\n\nprint(cnt)', 's = input()[::-1]\n \nsum_of_digits = 0\n \ncnts = [0] * 2019\n \ncnts[0] = 1\n \nd = 1\n \nfor c in s:\n sum_of_digits += int(c...
['Wrong Answer', 'Accepted']
['s632153120', 's490796240']
[9372.0, 9388.0]
[2206.0, 113.0]
[174, 280]
p02702
u067694718
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()\nn = len(s)\ns_cu = [0] * n\ncounter = [0] * 2019\n\nfor i in range(1, n+1):\n s_cu[i-1] = int(s[n-i:]) \n counter[int(s[n-i-1:]) % 2019] += 1\n\nans = 0\nfor i in counter:\n ans += (i * (i - 1)) // 2\n\nprint(ans)', 's = input()\nn = len(s)\ns_cu = [0] * (n+1)\ncounter = [0] * 2019\ncounter[0] +...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s118375004', 's655042289', 's607841683']
[27120.0, 16136.0, 16148.0]
[2206.0, 124.0, 355.0]
[222, 250, 261]
p02702
u070201429
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()\nn = len(s)\n\nl = [0]\nfor i in range(n):\n l.append(int(s[i:n]) % 2019)\n\nfrom collections import Counter\ndic = Counter(l)\n\nans = 0\nfor i in dic.values():\n ans += i * (i - 1) // 2\nprint(ans)\n\nprint(dic)', 's = input()\nn = len(s)\n\nnum = 1\nl = [0]\nfor i in range(n-1, -1, -1):\n l.ap...
['Wrong Answer', 'Accepted']
['s544520552', 's059141035']
[9460.0, 16608.0]
[2206.0, 133.0]
[216, 266]
p02702
u087356957
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['from sys import stdin\n#import numpy as np\n\n\ndef merge_sort(lst, low, high):\n if low >= high:\n return\n mid = int((low+high)/2)\n merge_sort(lst, low, mid)\n merge_sort(lst, mid+1, high)\n for i in range(low, mid+1):\n tmp_array[i] = lst[i]\n j = high\n for i in range(mid+1, hi...
['Runtime Error', 'Accepted']
['s263788203', 's913381240']
[26128.0, 25768.0]
[302.0, 329.0]
[1906, 1775]
p02702
u089142196
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S=input()\nn=len(S)\n\nT=[0]*n\nfor i in range(n):\n T[i]=int(S[i:])', 'S=input()\nN=len(S)\n\nT=[0]\nfor i in range(N):\n p = int(S[-1-i])\n T.append( (T[-1]+ pow(10,i,2019)*p)%2019 )\n \nfrom collections import Counter\nans=0\nU=dict(Counter(T))\nfor num in U:\n ans += U[num]*(U[num]-1)//2\nprint(ans...
['Wrong Answer', 'Accepted']
['s676709495', 's905902659']
[15276.0, 16692.0]
[2206.0, 338.0]
[66, 231]
p02702
u091051505
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()[::-1]\np = 0\ndp = [0] * 2019\ndp[0] = 1\nfor i in s:\n p = (p + (int(s) * (10 ** (i)))) % 2019\n dp[p] += 1\nans = 0\nfor i in dp:\n ans += i * (i - 1) // 2\nprint(ans)', 's = input()[::-1]\np = 0\ndp = [0] * 2019\ndp[0] = 1\nd = 1\nfor i in s: \n p = (int(i) * d + (p)) % 2019\n dp[p] +...
['Runtime Error', 'Accepted']
['s083516030', 's064264344']
[9384.0, 9312.0]
[204.0, 106.0]
[180, 209]
p02702
u092646083
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['mod_673 = [1] * 672\nfor i in range(1,672):\n mod_673[i] = (mod_673[i -1] * 10) % 672\n\nS = input()\nS = S[::-1]\nA = [0] * (len(S) + 1)\nB = [0] * (len(S) + 1)\nx = 0\nAns = [[0] * 3 for i in range(673)]\nfor i in range(1, len(S) + 1):\n A[i] = (A[i - 1] + int(S[i - 1]) * mod_673[(i - 1) % 672]) % 673\n B[...
['Wrong Answer', 'Accepted']
['s803938566', 's741651692']
[16012.0, 16016.0]
[221.0, 216.0]
[502, 502]
p02702
u093041722
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S = input()\na = [0,int(S)%2019]\ninit = 0\nfor i in range(len(S)-1):\n S = S[1:]\n a.append(int(S)%2019)\nb = [kv*(kv-1)//2 for kv in Counter(a).values() if kv > 1]\nprint(sum(b))', 'S = input()\nl = [int(n) for n in list(S)]\na = [0,int(S)%2019]\ninit = 0\nfor i in range(len(S)-1):\n S = S[1:]\n a.appen...
['Runtime Error', 'Runtime Error', 'Accepted']
['s168462888', 's279086884', 's213567060']
[9468.0, 12188.0, 52648.0]
[2206.0, 2206.0, 295.0]
[179, 209, 335]
p02702
u095192632
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S = input()\nN = len(S)\nprint(N)\ncnt = 0\n\nfor i in range(N):\n for j in range(i+4, N+1):\n if int(S[i:j]) % 2019 == 0:\n cnt += 1\nprint(cnt)\n\n', 's = list(input())\nmods = [0]*(len(s))\ncountRemainder = [0] * 2019\ncnt = 0\n\n\nm = 1\nmod = 0\nfor i in range(len(s)):\n mod += int(s[len(...
['Wrong Answer', 'Accepted']
['s632647693', 's752993784']
[9312.0, 11984.0]
[2205.0, 148.0]
[159, 349]
p02702
u102367647
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["def main():\n S = list(map(int,list(input())))\n N = len(S)\n t = 0\n A = [0] * 2019\n for i in range(N):\n t = (t + S[-1-i] * 10 ** i) % 2019\n A[t] += 1\n result = sum([a*(a-1)//2 for a in A])\n print(result)\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n S = li...
['Wrong Answer', 'Accepted']
['s041710814', 's543391365']
[12092.0, 10468.0]
[2205.0, 84.0]
[277, 324]
p02702
u102461423
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nimport numpy as np\n\nS = np.array(list(read().rstrip()), dtype=np.int32) - ord('0')\n", 'import numpy as np', "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadli...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s094401564', 's134194382', 's656329832', 's854707655', 's882712055', 's516247068']
[28940.0, 26960.0, 29160.0, 91564.0, 29200.0, 109268.0]
[121.0, 109.0, 1900.0, 382.0, 2079.0, 730.0]
[199, 18, 775, 600, 775, 484]
p02702
u110199424
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S = str(input())\n\ndata = []\n\ncount = 0\nfor i in range(len(S)):\n for j in range(i+4, min(i+7,len(S)+1)):\n if(int(S[i:j]) % 2019 == 0):\n count += 1\n data.append([i,j])\n\nfor i in range(len(data)):\n if(data[i][1] == data[i+1][0]):\n count += 1\n\nprint(count)', 'S = s...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s073232499', 's513398218', 's558389232', 's323154564']
[16752.0, 9512.0, 9484.0, 16820.0]
[328.0, 2206.0, 23.0, 353.0]
[294, 279, 275, 280]
p02702
u111652094
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['\nS=str(input())\nl=len(S)\nans=0\n\nmod=[0]*2019\nmod[0]+=1\nt=0\nfor i in range(l):\n t=int(S[l-i:-1:-1])*pow(10,i,2019)\n mod[t%2019]+=1\n \nfor j in range(len(mod)):\n m=mod[j]\n ans=ans+m*(m-1)//2\nprint(ans)', "S=str(input())\nS.split()\nans=0\nlist_2019=[]\n\n\nfor i in range(1,10**4):\n list...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s842127449', 's859931615', 's873471155', 's739312188']
[9264.0, 9864.0, 48824.0, 9128.0]
[22.0, 2205.0, 2207.0, 115.0]
[213, 272, 151, 204]
p02702
u114641312
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['# from math import factorial,sqrt,ceil,gcd\n# from itertools import permutations as permus\n# from collections import deque,Counter\n# import re\nfrom functools import lru_cache \n# from decimal import Decimal, getcontext\n\n# # eps = Decimal(10) ** (-100)\n\n# import numpy as np\n# import networkx as nx\n# from scip...
['Wrong Answer', 'Accepted']
['s143663803', 's958729804']
[39800.0, 9716.0]
[2264.0, 120.0]
[1282, 1045]
p02702
u123872895
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['inp = input()\n\ns = 0\n\nfor i in range(len(inp)-3):\n\tnum = int(inp[i:])\n\twhile num > 2019:\n\t\tprint(num)\n\t\tif num % 2019 == 0:\n\t\t\ts += 1\n\t\tnum = num // 10\n\nprint(s)', 'inp = input()\n\ns = 0\n\nfor i in range(len(inp)-3):\n\tnum = int(inp[i:-1])\n while num >2019:\n\t\tif num % 2019 == 0:\n\t\t...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s771146084', 's879728952', 's265232259']
[9540.0, 8824.0, 12200.0]
[2213.0, 21.0, 114.0]
[161, 151, 259]
p02702
u127499732
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["def main():\n s = input()\n ans = 0\n for i in range(1, 1001, 1):\n x = str(2019 * i)\n ans += s.count(x)\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "def main():\n from collections import Counter\n s = input()\n\n l = [0]\n t = 1\n for i, x in enumerate(s[::-...
['Wrong Answer', 'Accepted']
['s525819442', 's253943724']
[9056.0, 16784.0]
[263.0, 108.0]
[179, 338]
p02702
u151785909
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()\nans = 0\nfor i in range(len(s)-3):\n for j in range(4,len(s)-i):\n t=s[i:j+i]\n if int(t)%2019==0:\n ans+=1\nprint(ans)', 'n = list(input())\nn.reverse()', 'from collections import Counter\n\nn = list(input())\nn.reverse()\nx = [0]*(len(n))\na=0\nfor i in range(len(n)):\n a...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s025019497', 's865494174', 's956037793', 's449861672']
[9340.0, 10360.0, 13036.0, 18008.0]
[2206.0, 26.0, 2206.0, 126.0]
[153, 29, 146, 255]
p02702
u153302617
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = str(input())\nN = len(s)\narray = [0]*2019\narray[0] += 1\ncount = 0\nfor i in reversed(range(0, N)):\n x = s[i:N]\n y = int(x)\n array[y%2019] += 1\n\nfor i in array:\n count += i*(i-1)/2\nprint(count)\n', 's = str(input())\nN = len(s)\narray = [0]*2019\narray[0] += 1\ncount = 0\nd = 1\nr = 0\nfor i ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s399183745', 's896930984', 's884344021']
[9148.0, 9284.0, 9304.0]
[2206.0, 260.0, 108.0]
[207, 269, 249]
p02702
u156815136
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["from statistics import median\n#import collections\n\nfrom fractions import gcd\nfrom itertools import combinations \nfrom collections import deque\nfrom collections import defaultdict\nimport bisect\n#\n# d = m - k[i] - k[j]\n\n#\n#\n#\n\n#\n#\n\nimport sys\nsys.setrecursionlimit(10000000)\nmod = 10**9 + 7\n\ndef...
['Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s074345417', 's533014281', 's535964327', 's704312817', 's710378259']
[11176.0, 11248.0, 11176.0, 11308.0, 9588.0]
[2206.0, 2206.0, 2206.0, 2206.0, 131.0]
[973, 932, 924, 947, 363]
p02702
u161432819
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import sys\ninput = sys.stdin.readline\n\nS = input()\nl = len(S)\n\ncount = 0\nfor i in range(0, l-3):\n for j in range(3, l):\n if i < (j-3):\n new_s = int(S[i:j+1])\n if new_s % 2019 == 0:\n count += 1\n else:\n continue\n else:\n continue\nprint(count)', 'from collections ...
['Wrong Answer', 'Accepted']
['s686664428', 's995933300']
[9336.0, 16604.0]
[2206.0, 337.0]
[280, 226]
p02702
u163529815
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S = list(input())\nS.reverse()\namari = []\nA = 0\nc = 0\nfor i in range(len(S)):\n a = (int(A) + int(S[i]) *(10 ** i)) % 2019\n amari.append(a)\n A = a\nprint(c + len(amari) - len(set(amari)))\n', 'import sys\ndef input():\n return sys.stdin.readline()[:-1]\n\n\ndef main():\n S = input()[::-1] \n c...
['Wrong Answer', 'Accepted']
['s513598255', 's627089639']
[11256.0, 9320.0]
[2206.0, 82.0]
[194, 540]
p02702
u165133750
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = str(input())\nn = len(s)\nprint(s)\ns = s[::-1]\nprint(s)\nx, tot = 1, 0\nm = 2019\nans = 0\ncnt = [int() for _ in range(m)]\nfor i in range(n):\n cnt[tot] += 1\n tot += (int(s[i])) * x\n tot %= m\n ans += cnt[tot]\n x = x * 10 % m\nprint(ans)\n', 's = str(input())\nn = len(s)\ns = s[::-1]\nx, tot ...
['Wrong Answer', 'Accepted']
['s555077756', 's601185871']
[9204.0, 9248.0]
[133.0, 136.0]
[248, 230]
p02702
u169138653
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import sys\ninput=sys.stdin.readline\ns=input()\nn=len(s)\ns=s[::-1]\naccum=[0]*n\np=2019\nd=dict()\nfor i in range(n):\n accum[i]=int(s[i])*pow(10,i,p)%p\nfor i in range(n-1):\n accum[i+1]+=accum[i]\n accum[i+1]%=p\naccum[-1]%=p\nans=0\n#print(accum)\nfor i in range(n):\n #print(d)\n if accum[i] not i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s257857154', 's417896472', 's707835283', 's056174959']
[10712.0, 10672.0, 10624.0, 16488.0]
[26.0, 22.0, 23.0, 447.0]
[481, 482, 481, 445]
p02702
u169350228
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import numpy as np\nimport math\ns = str(input())\nn = len(s)\nwa = [0 for i in range(n+1)]\nfor i in range(1,n+1):\n wa[i] = (wa[i-1]+int(s[i-1]))%9\n\nans = 0\n\nfor i in range(n):\n for j in range(i+3,n):\n if (wa[j]-wa[i])%9 == 3 or (wa[j]-wa[i])%9 == 6:\n if int(s[i:j+1])%2019 == 0:\n ...
['Wrong Answer', 'Accepted']
['s204614583', 's238270139']
[28936.0, 28796.0]
[2206.0, 234.0]
[337, 381]
p02702
u170761365
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['number = str(input())[::-1]\nremainderDictionary = {}\n \nsum = 0\nx = 1\nfor i in number:\n sum += int(i) * x\n remainder = sum % 2019\n remainderValue = remainderDictionary.get(remainder,0) + 1\n remainderDictionary[remainder] = remainderValue\n x = (x * 10) % 2019\n \nans = 0\nfor i in remainderDiction...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s197014003', 's330385919', 's476778416', 's507738359', 's521099091', 's613253096', 's763327640', 's814666297', 's847409638', 's932033884', 's946466776', 's671523160']
[9360.0, 9208.0, 9240.0, 9000.0, 3504904.0, 9352.0, 9240.0, 521596.0, 9208.0, 9264.0, 525384.0, 9364.0]
[131.0, 133.0, 21.0, 20.0, 2273.0, 21.0, 133.0, 2220.0, 114.0, 128.0, 2219.0, 97.0]
[395, 379, 256, 545, 407, 346, 383, 504, 208, 379, 1074, 723]
p02702
u175034939
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['from collections import defaultdict\nS = list(input())[::-1]\nn = len(S)\nd = defaultdict(int)\nd[0] += 1\nres = 0\nfor i, s in enumerate(S):\n res += int(s)*pow(10, i, 6)\n res %= 6\n d[res] += 1\n\nans = 0\nfor v in d.values():\n ans += v*(v-1)//2\nprint(ans)', 'from collections import defaultdict\nS = ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s288532920', 's705163217', 's727346497']
[12192.0, 12108.0, 12144.0]
[256.0, 338.0, 337.0]
[259, 287, 265]
p02702
u179304833
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['from collections import deque\nimport time\nstart = time.time()\n\ns = str(input())\n\nn=len(s)\ni :int=0\n\nspan :int=1\nmlist=deque("0")\nslist :str=""\n\n\n #slist = str(sss) + slist\n #m = int(slist)%2019\n #mlist.append(str(m))\n #print(str(mlist))\n #span+=1\n\n#ll=len(mlist)\n#l=len(set(mlist))\n#print(ll...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s283631010', 's355622018', 's433261458', 's587606151', 's654804746', 's228395952']
[9468.0, 9680.0, 9860.0, 9764.0, 10204.0, 18728.0]
[23.0, 2206.0, 2206.0, 2206.0, 2206.0, 167.0]
[376, 177, 255, 369, 384, 299]
p02702
u185297444
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['#ABC164d\ndef main():\n s = input()\n MOD = 2019\n d = [ 0 for i in range(MOD)]\n # print(d)\n ans = 0\n k = 0\n d[0] = 1\n s = s[::-1]\n # print(s)\n p = 1\n for i in s:\n print(p,i,k)\n print(\'pnosiki\')\n print(p * int(i) + k)\n k = (p * int(i) + k) % M...
['Wrong Answer', 'Accepted']
['s531023523', 's368080153']
[9392.0, 9344.0]
[457.0, 86.0]
[470, 480]
p02702
u188745744
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import sys\ntmp=sys.stdin.readline()\ndef main():\n cnt=[0]*2019\n cnt[0]+=1\n for i in reversed(range(len(tmp))):\n cnt[int(tmp[i:])%2019] += 1\n import collections\n cnt=collections.Counter(cnt).items()\n ans=0\n for i,j in cnt:\n if i > 1:\n ans+=i*(i-1)//2*j\n print(ans)\n\nif __...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s001384994', 's175455909', 's771685860', 's957156562']
[9272.0, 9568.0, 9288.0, 9312.0]
[24.0, 28.0, 20.0, 81.0]
[335, 332, 335, 286]
p02702
u188827677
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()[::-1]\n\ncounts = [0]*2019 \ncounts[0] = 1 \n\nnum, d = 0,1\u3000\n\nfor char in s:\n num += int(char) * d\n num %= 2019\n d *= 10\n d %= 2019\n counts[num] += 1\n\nans = 0\nfor c in counts:\n ans += c*(c-1)//2\n \nprint(ans)', 's = input()[::-1]\n\ncounts = [0]*2019 \ncounts[0] = 1 \n\nnum, d = 0,...
['Runtime Error', 'Accepted']
['s474430605', 's649060911']
[8964.0, 9368.0]
[24.0, 111.0]
[673, 671]
p02702
u189023301
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["import sys\ninput = sys.stdin.readline\n\ndef main():\n n = input()\n l = len(n)\n mody = 2019\n cnt = 0\n for i in range(l - 3):\n x = int(n[i:i + 4])\n x %= mody\n if x == 0:\n cnt += 1\n for j in range(i + 4, l):\n x = 10 * x + int(n[j])\n ...
['Runtime Error', 'Accepted']
['s671061935', 's563316073']
[9200.0, 19596.0]
[66.0, 113.0]
[415, 397]
p02702
u189513668
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import re\nS = input()\n#print(type(S))\n\ns = []\nfor i in range(int(S) // 2019):\n s.append(str(i*2019))\n\ncount = 0\nfor i in s:\n S_ = S\n while re.search(i, S_):\n #print(i)\n S_ = S_[:re.search(i, S_).start()] + "," + S_[re.search(i, S_).start()+1:]\n count += 1\n \nprint(c...
['Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s013888492', 's048047404', 's105843195', 's370452855', 's387659699', 's837455743', 's884052426', 's990351730', 's019730642']
[521536.0, 39984.0, 18688.0, 10812.0, 11548.0, 522580.0, 9164.0, 18680.0, 9372.0]
[2220.0, 349.0, 837.0, 2206.0, 2206.0, 2221.0, 21.0, 848.0, 136.0]
[307, 150, 430, 296, 297, 312, 151, 430, 436]
p02702
u192042624
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import numpy as np\nimport sys\nimport math\n\nS = input()\n\ntmp = []\n\nfor i in range(1,50008):\n x = 2019 * i\n if str(x).find("0") == -1:\n tmp.append(x)\n\nans = 0\nll = len(S)\nfor wide in range(5,9):\n for i in range(ll - wide):\n ss = S[i:i+wide]\n if ss in tmp:\n ans...
['Wrong Answer', 'Accepted']
['s254679090', 's944382618']
[28220.0, 34172.0]
[2206.0, 244.0]
[744, 362]
p02702
u193264896
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["import sys\nread = sys.stdin.read\nreadline = sys.stdin.buffer.readline\nfrom collections import defaultdict\nINF = float('inf')\n\ndef main():\n S = readline().decode('utf-8')\n L = len(S)\n d = defaultdict(int)\n\n for i in range(L):\n s = int(S[i:])\n a = s%2019\n d[a] += 1\n\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s021537236', 's035899241', 's395662535', 's503394214', 's636564583', 's384641727']
[9832.0, 11412.0, 9776.0, 9116.0, 9284.0, 9272.0]
[2206.0, 2206.0, 2206.0, 24.0, 65.0, 86.0]
[479, 440, 479, 353, 313, 471]
p02702
u195054737
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['import sys\nimport itertools\nimport numpy as np\nimport time\nimport math\nimport re\n\nsys.setrecursionlimit(10**7)\n\nfrom collections import defaultdict\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\ndef main():\n s = input()\n\n tmp_list = [...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s048849307', 's344868846', 's897019147']
[30584.0, 30564.0, 34516.0]
[596.0, 173.0, 387.0]
[642, 619, 600]
p02702
u196746947
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['\n#include<string>\nusing namespace std;\nstring s;\nint n;\nn=s.length()\ncin>>s\nint sum=0;\nfor(int i=0;i<n,i++){\nfor(int j=i+1;j<n,j++){\nstring num=str.substr(i,j-i+1);\n int x=stoi(num);\n if(x%2019==0){\n sum+=1;\n }\n \n}\n}\ncout<<sum;', 'import sys\nimport collections as coun\nsys.setrecursionlimit(10...
['Runtime Error', 'Accepted']
['s779566365', 's802996399']
[8920.0, 16640.0]
[19.0, 397.0]
[250, 564]
p02702
u197457087
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['from collections import Counter\nS = str(input())\nN = len(S)\n\n\nsmod = [0]\ntemp = 0\nfor i in range(N):\n temp = temp + int(S[(N-1)-i])*pow(10,i)\n print(temp)\n smod.append(temp%2019)\n\n\ncmod = Counter(smod)\nprint(cmod)\n\nans = 0\nfor i in cmod.values():\n ans += i*(i-1)/2\nprint(int(ans))', 'fro...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s343546951', 's440019693', 's127405981']
[31900.0, 11800.0, 16608.0]
[2273.0, 2206.0, 141.0]
[335, 365, 391]
p02702
u197968862
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['s = input()\n\nmod = [1] + [0]*2018\nt = 0\na = 0\nn = len(s)\ns = reversed(s)\nfor i in range(n):\n t += int(s[i]) * (10 ** a)\n a += 1\n mod[t%2019] += 1\n print(t,t%2019)\nans = 0\nfor i in range(2019):\n ans += mod[i]*(mod[i]-1)//2\nprint(ans)', 's = input()\n\nt, a = 0, 1\nmod = [0]*2019\nmod[0] =...
['Runtime Error', 'Accepted']
['s633982360', 's482510768']
[9192.0, 9268.0]
[24.0, 119.0]
[247, 264]
p02702
u198668088
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
["S = list(input())\nmod_list = []\n\nfor i in range(len(S)-3):\n for j in range(i+4, len(S)+1):\n num = int(''.join(S[i:j]))\n mod_list.append(num % 2019)\n\nprint('test')", 'S = list(input())[::-1]\nans = 0\nmods = [0] * 2019\nmods[0] = 1 # If 2019 is exist, count number\ncurrent = 0\nx = 1\nfor s i...
['Wrong Answer', 'Accepted']
['s041531732', 's850321943']
[10900.0, 11700.0]
[2206.0, 121.0]
[179, 251]
p02702
u199830845
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S = list(input())\nN = len(S)\n\n\n\n\ncounter = [0] * 2019\nindices = []\nk = 10\nfor i in range(N + 1):\n if i == 0:\n sub = 0\n counter[i] = 0\n elif i == 1:\n sub = int(S[N - 1])\n counter[i] = sub % 2019\n else:\n \n sub += int(S[N - i]) * k\n k *= 10\n\n...
['Runtime Error', 'Accepted']
['s182331158', 's856726333']
[10660.0, 10532.0]
[23.0, 139.0]
[928, 658]
p02702
u202560873
2,000
1,048,576
Given is a string S consisting of digits from `1` through `9`. Find the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition: Condition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.
['S = input()\nN = len(S)\n\ncounter = [0] * 2019\ncounter[0] = 1\nT = 0\nR = 1\nfor i in range(N):\n T = (T + R * int(S[n - i - 1])) % 2019\n R = 10 * R % 2019\n counter[T] += 1\n\nans = 0\nfor i in range(2019):\n m = counter[i]\n ans += m * (m - 1) // 2\n\nprint(ans)', 's = input()\nt = s[::-1]\nn = le...
['Runtime Error', 'Accepted']
['s293900359', 's189241501']
[9364.0, 9204.0]
[24.0, 116.0]
[265, 297]