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
p02802
u867826040
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['up = [input().split() for i in range(m)]\n\nwa,ac = 0,0\nif m==0:\n print(0,0)\nelse:\n k = [[] for i in range(2)]\n f=0\n temp=up[0]\n for t in up:\n if not temp[0]==t[0]:\n f+=1\n k[f].append(t)\n temp=t\n temp = False\n for qrs in k:\n for qr in qrs:\n if qr[1] == "WA":\n wa+=1\n elif qr[1] == "AC" and not temp:\n ac+=1\n break\n print(ac,wa)\n', 'n,m = map(int,input().split())\nac,wa = 0,0\nd = {}\nfor i in range(m):\n p,s = input().split()\n if p in d:\n if d[p][1]:\n pass\n else:\n if s=="WA":\n d[p][0]+=1\n elif s=="AC":\n d[p][1]=True\n ac+=1\n wa+=d[p][0]\n else:\n if s=="WA":\n d[p]=[1,False]\n wa+=1\n elif s=="AC":\n d[p]=[0,True]\n ac+=1\nprint(ac,wa)', 'n,m = map(int,input().split())\nac,wa = 0,0\nd = {}\nfor i in range(m):\n p,s = input().split()\n if p in d:\n if d[p][1]:\n pass\n else:\n if s=="WA":\n d[p][0]+=1\n elif s=="AC":\n d[p][1]=True\n ac+=1\n wa+=d[p][0]\n else:\n if s=="WA":\n d[p]=[1,False]\n elif s=="AC":\n d[p]=[0,True]\n ac+=1\nprint(ac,wa)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s680200190', 's794899140', 's765790255']
[3064.0, 25312.0, 25312.0]
[17.0, 282.0, 295.0]
[456, 382, 370]
p02802
u867848444
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["from collections import defaultdict\nn,m=map(int,input().split())\np,s=[],[]\nfor i in range(m):\n P,S=input().split()\n p.append(int(P))\n s.append(S)\n\npena=0\ncnt=defaultdict(lambda :0)\ntemp=0\nfor x,y in zip(p,s):\n if y=='AC':\n cnt[x]=1\n pena+=temp\n\n elif cnt[x]!=1 and y=='WA':\n temp+=1\n\nprint(sum(cnt.values()),pena)", "from collections import defaultdict\nn,m=map(int,input().split())\np,s=[],[]\nfor i in range(m):\n P,S=input().split()\n p.append(int(P))\n s.append(S)\n\npena=0\ncnt_ac=defaultdict(lambda :0)\ncnt_wa=defaultdict(lambda :0)\nfor x,y in zip(p,s):\n if cnt_ac[x]==0:\n if y=='AC':\n cnt_ac[x]=1\n pena+=cnt_wa[x]\n\n elif y=='WA':\n cnt_wa[x]+=1\n\nprint(sum(cnt_ac.values()),pena)\n"]
['Wrong Answer', 'Accepted']
['s564548018', 's143532952']
[22968.0, 29088.0]
[297.0, 336.0]
[349, 419]
p02802
u870559097
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N, M = map(int, input().split())\nCounted = [0 for _ in range(N)]\nnum1 = 0\nnum2 = 0\nsubnum2 = [0 for l in range(N)]\nfor j in range(M):\n p, S = input().split()\n p_ = int(p)\n if S == "AC" and Counted[p_] == 0:\n num1 += 1\n num2 += subnum2[p_ - 1]\n Counted[p_] = 1\n elif S == "WA" and Counted[p_] == 0:\n subnum2[p_ - 1] += 1\nprint("{} {}".format(num1, num2))', 'N, M = map(int, input().split())\nCounted = [0 for _ in range(N)]\nnum1 = 0\nnum2 = 0\nsubnum2 = [0 for l in range(N)]\nfor j in range(M):\n p, S = input().split()\n p_ = int(p)\n if S == "AC" and Counted[p_ -1] == 0:\n num1 += 1\n num2 += subnum2[p_ - 1]\n Counted[p_ -1] = 1\n elif S == "WA" and Counted[p_-1] == 0:\n subnum2[p_ - 1] += 1\nprint("{} {}".format(num1, num2))\n']
['Runtime Error', 'Accepted']
['s367271064', 's229724833']
[4656.0, 4656.0]
[285.0, 292.0]
[369, 378]
p02802
u871934301
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N,M=map(int,input().split())\nwa=0\nac=0\nalready=[]\nfor i in range(M):\n P,S=map(input().split())\n if S=="WA" and already.count(P)==0:\n wa=wa+1\n if S=="AC" and already.count(P)==0:\n ac=ac+1\n already.append(P)\n else:\n pass\nprint(wa,ac)\n\n\n \n \n\n\n \n\n \n\n\n', 'N,M=map(int,input().split())\nac=0\nwa=0\nmydict={}\nw=[]\np=[]\nfor i in range(M):\n P,S=input().split()\n if S=="WA":\n if w.count(P)==0:\n mydict[P]=1\n p.append(P) \n else:\n mydict[P]=mydict[P]+1\n else:\n if p.count(P)==0:\n ac=ac+1\n p.append(P)\n if w.count(P)!=0:\n wa=wa+mydict[P]\n else:\n pass\nprint(ac,wa)\n\n \n\n\n\n', 'N,M=map(int,input().split())\nwa=0\nac=0\nalready=[]\nfor i in range(M+1):\n P,S=map(input().split())\n if S=="WA" and already.count(P)==0:\n wa=wa+1\n if S=="AC" and already.count(P)==0:\n ac=ac+1\n already.append(P)\n else:\n pass\nprint(wa,ac)\n\n\n \n \n\n\n \n\n \n\n\n', 'N,M=map(int,input().split())\nac=0\nwa=0\nmydict={}\nw=[]\np=[]\nfor i in range(M):\n P,S=input().split()\n if S=="WA":\n if w.count(P)==0:\n mydict[P]=1\n p.append(P) \n else:\n mydict[P]=mydict[P]+1\n else:\n if p.count(P)==0:\n ac=ac+1\n p.append(P)\n if w.count(P)!=0:\n wa=wa+mydict[P]\n else:\n pass\nprint(wa,ac)\n\n \n\n\n\n', 'N,M=map(int,input().split())\nac=0\nwa=0\nmydict={}\nw=[]\np=[]\nfor i in range(M):\n P,S=input().split()\n if S=="WA":\n if w.count(P)==0:\n mydict[P]=1\n w.append(P) \n else:\n mydict[P]=mydict[P]+1\n else:\n if w.count(P)==0:\n ac=ac+1\n p.append(P)\n if w.count(P)!=0:\n wa=wa+mydict[P]\n else:\n pass\nprint(ac,wa)\n\n \n\n\n\n', 'N,M=map(int,input().split())\nac=0\nwa=0\na=[0]*N\nw=[0]*N\nfor i in range(M):\n P,S=input().split()\n if S=="WA":\n w[int(P)-1]+=1\n else:\n if a[int(P)-1]==0:\n a[int(P)-1]+=1\n ac=ac+1\n wa+=w[int(P)-1]\n else:\n pass\nprint(ac,wa)\n\n \n\n\n\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s032666295', 's110585344', 's320831929', 's799500966', 's914861106', 's831865281']
[3060.0, 12416.0, 3188.0, 12412.0, 9372.0, 4596.0]
[17.0, 2104.0, 18.0, 2105.0, 2104.0, 331.0]
[296, 440, 298, 440, 440, 306]
p02802
u875600867
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['\n\nN, M = map(int, input().split())\n\nAC = []\nWC = []\nansAC\nansRC\n\nfor i in range(0, M):\n AC[i] = False\n WA[i] = 0\n\nfor m in range(0, M):\n p, s = input().split()\n \n if s == "AC" and int(p) <= N:\n AC[p] = True\n ansAC +=1\n ansWC += WA[p]\n \n elif s == "WA" and (p not in ans):\n WA[p] +=1\n else:\n continue\n\nprint(len(set(ans)), pena)', "import sys\nfrom collections import defaultdict\n\nn, m = map(int, input().split())\nac = 0\n\nwa = defaultdict(lambda: 0)\nalready = set()\nfor line in sys.stdin:\n p, s = line.strip().split()\n p = int(p)\n \n if p in already:\n continue\n \n if s == 'AC':\n ac += 1\n already.add(p)\n \n else:\n wa[p] += 1\n\nprint(ac, sum(wa[i] for i in already))\n"]
['Runtime Error', 'Accepted']
['s718977257', 's690138533']
[3064.0, 22888.0]
[17.0, 157.0]
[437, 519]
p02802
u882696550
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['hist = []\nnm = list(map(int, input().split()))\nfor i in range(nm[1]):\n a,b=input().split()\n hist.append((int(a), b))\n\nac = [0] * nm[0]\nwa = [0] * nm[0]\n\nfor i in range(nm[1]):\n if hist[i][1] == "AC":\n if ac[hist[i][0]-1] != 1:\n ac[hist[i][0]-1] = 1\n elif hist[i][1] == "WA":\n if ac[hist[i][0]-1] != 1:\n wa[hist[i][0]-1] = wa[hist[i][0]-1] + 1\n\nfor i in range(nm[0]):\n wa[i] = wa[i] * (1-ac[i])\n\nprint(sum(ac), sum(wa))', 'hist = []\nnm = list(map(int, input().split()))\nfor i in range(nm[1]):\n a,b=input().split()\n hist.append((int(a), b))\n\nac = [0] * nm[0]\nwa = [0] * nm[0]\n\nfor i in range(nm[1]):\n if hist[i][1] == "AC":\n if ac[hist[i][0]-1] != 1:\n ac[hist[i][0]-1] = 1\n elif hist[i][1] == "WA":\n if ac[hist[i][0]-1] != 1:\n wa[hist[i][0]-1] = wa[hist[i][0]-1] + 1\n\n\nfor i in range(nm[0]):\n wa[i] = wa[i] * ac[i]\n\nprint(sum(ac), sum(wa))']
['Wrong Answer', 'Accepted']
['s567733251', 's798769376']
[20492.0, 20492.0]
[335.0, 336.0]
[469, 466]
p02802
u883203948
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = list(map(int,input().split()))\ncounter = 0\ndata = []\n\nfor i in range(n):\n data.append(input().split())\nnum = [int(s) for s in range(1,n+1)]\ncheckd = []\ntmp = 0\nwa = 0\nfor i in range(n):\n if data[i][1] == "WA":\n tmp += 1\n elif data[i][1] == "AC" and data[i][0] not in checkd:\n counter += 1\n checkd.append(data[i][0])\n wa += tmp\n tmp = 0\nprint(counter,wa)\n\n \n \n\n', 'n,m = list(map(int,input().split()))\ncounter = 0\ndata = []\ntmp = {}\n\nwa = 0\n\nfor _ in range(m):\n a,b = input().split() \n if b == "WA": \n if int(a) not in tmp:\n tmp[int(a)] = 0\n if tmp[int(a)] != -1:\n tmp[int(a)] += 1\n if int(a) not in tmp: \n tmp[int(a)] = 0\n if (( b == "AC") and (tmp[int(a)] != -1)):\n counter += 1\n #checkd.append(int(a))\n wa += tmp[int(a)] \n tmp[int(a)] = -1 \n\n\n"""\nfor i in range(m):\n if data[i][1] == "WA":\n if int(data[i][0]) not in tmp:\n tmp[int(data[i][0])] = 0\n tmp[int(data[i][0])] += 1 \n elif ((data[i][1]) == "AC") and (int(data[i][0]) not in checkd):\n counter += 1\n checkd.append(int(data[i][0]))\n if int(data[i][0] ) not in tmp:\n tmp[int(data[i][0])] = 0 \n wa += tmp[int(data[i][0])]\n""" \nprint(counter,wa)\n\n \n \n\n']
['Runtime Error', 'Accepted']
['s812970578', 's198695411']
[36208.0, 15028.0]
[2106.0, 390.0]
[399, 1104]
p02802
u884601206
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m=map(int,input().split())\nif m==0:\n print(0,0)\nelse:\n p=[list(map(str,input().split())) for i in range(m)]\n q=[]\n s=[0]*n\n t=0\n for i in range(len(p)):\n if p[i][1]==\'AC\' and not p[i][0] in q:\n q.append(p[i][0])\n t+=s\n \n elif p[i][1]=="WA":\n if not p[i][0] in q:\n s[i]+=1\n \n \n \n \n print(len(q),t)\n ', 'n,m=map(int,input().split())\nif m==0:\n print(0,0)\nelse:\n p=[list(map(str,input().split())) for i in range(m)]\n q=[]\n s=[0]*n\n t=0\n for i in range(len(p)):\n if p[i][1]==\'AC\' and not p[i][0] in q:\n q.append(p[i][0])\n t+=s\n \n elif p[i][1]=="WA":\n if not p[i][0] in q:\n s[i]+=1\n \n \n \n \n print(len(q),len(s))\n ', 'n,m=map(int,input().split())\nif m==0:\n print(0,0)\nelse:\n p=[list(map(str,input().split())) for i in range(m)]\n q=[]\n s=[0]*n\n t=0\n for i in range(len(p)):\n if p[i][1]==\'AC\' and not p[i][0] in q:\n q.append(p[i][0])\n t+=s[i]\n \n elif p[i][1]=="WA":\n if not p[i][0] in q:\n s[i]+=1\n \n \n \n \n print(len(q),t)\n ', 'n,m=map(int,input().split())\nif m==0:\n print(0,0)\nelse:\n q=[0]*(n+1)\n s=[0]*(n+1)\n t=0\n for i in range(m):\n p,u=map(str,input().split())\n p=int(p)\n if q[p]==1:\n continue\n \n elif u==\'AC\':\n q[p]=1\n \n t+=s[p]\n \n \n elif u=="WA":\n if q[p]==0:\n s[p]+=1\n \n \n \n \n \n print(sum(q),t)\n ']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s011973623', 's473740088', 's709732220', 's339128205']
[32912.0, 32912.0, 33040.0, 4596.0]
[326.0, 295.0, 2106.0, 343.0]
[346, 351, 349, 353]
p02802
u886459614
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = map(int, input().split())\n\nac = [0]*(n+1)\nwa = [0]*(n+1)\n\n\nfor i in range(m):\n\tp, s = input().split()\n p = int(p)\n \n if s== "AC":\n\t\tac[p] = 1\n else:\n if a[p]==0:\n \twa[p]+=1\n\nfor i in range(m):\n\tif ac[i]=0:\n\t\twa[p]=0\n \nprint(sum(ac),sum(wa))\n', 'n,m = map(int, input().split())\n\nac = [0]*(n)\nwa = [0]*(n)\n\n\nfor i in range(m):\n\tp, s = input().split()\n p = int(p)\n \n if s== "AC":\n\t\tac[p] = 1\n else:\n wa[p]+=1\n\nfor i in range(m):\n\tif ac[i]=0:\n\t\twa[p]=0\n \nprint(sum(ac),sum(wa))', 'n,m = map(int, input().split())\n\nac = [0]*(n+1)\nwa = [0]*(n+1)\n\n\nfor i in range(m):\n\tp, s = input().split()\n\tp = int(p)\n \n\tif s== "AC":\n\t\tac[p] = 1\n\telse:\n\t\tif ac[p]==0:\n\t\t\twa[p]+=1\n\nfor i in range(n+1):\n\tif ac[i]==0:\n\t\twa[i]=0\n \nprint(sum(ac),sum(wa))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s394313366', 's882639520', 's703759814']
[2940.0, 2940.0, 4596.0]
[17.0, 17.0, 284.0]
[280, 254, 263]
p02802
u886832246
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["N, M = map(int, input().split())\np = []\nS = []\nfor i in range(M):\n pp, SS = map(str, input().split())\n p.append(pp)\n S.append(SS)\n\na = []\nfor i in range(M):\n a.append(int(p[i]))\n\nAC = 0\nP = 0\n\nQ = []\nR = []\nfor i in range(N):\n Q.append(0)\n R.append(0)\n\nfor i in range(M):\n index = a[i] - 1\n if Q[index] == 0 and S[i] == 'AC':\n AC = AC + 1\n Q[index] = 1\n elif Q[index] == 0 and S[i] == 'WA':\n R[i] = R[i] + 1\n\nfor i in range(N):\n if Q[i] == 0:\n P = 0\n else: P = P + R[i]\n\nprint(AC, P)", "N, M = map(int, input().split())\np = []\nS = []\nfor i in range(M):\n pp, SS = map(str, input().split())\n p.append(pp)\n S.append(SS)\n\na = []\nfor i in range(M):\n a.append(int(p[i]))\n\nAC = 0\nP = 0\n\nQ = []\nR = []\nfor i in range(N):\n Q.append(0)\n R.append(0)\n\nfor i in range(M):\n index = a[i] - 1\n if Q[index] == 0 and S[i] == 'AC':\n AC = AC + 1\n Q[index] = 1\n elif Q[index] == 0 and S[i] == 'WA':\n R[a[i] - 1] = R[a[i] - 1] + 1\n\nfor i in range(N):\n if Q[i] == 0:\n P = P\n else: P = P + R[i]\n\nprint(AC, P)"]
['Runtime Error', 'Accepted']
['s748114952', 's169143350']
[21688.0, 21272.0]
[379.0, 411.0]
[544, 558]
p02802
u888092736
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["from collections import defaultdict\n\nn, m = map(int, input().split())\nps = []\nfor _ in range(m):\n ps.append(input().split())\n\nsub_st = defaultdict(list)\nfor p, s in ps:\n sub_st[p].append(s)\n\nsolved = 0\nerror = 0\nfor k, v in sub_st.items():\n temp_error = 0\n for history in v:\n if 'AC' in v:\n error += temp_error\n solved += 1\n break\n temp_error += 1\n\nprint(solved, error)\n", "from collections import defaultdict\n\nn, m = map(int, input().split())\nps = []\nfor _ in range(n):\n ps.append(map(int, input().split()))\n\nsub_st = defaultdict(list)\nfor p, s in ps:\n sub_st[p].append(s)\n\nsolved = 0\nerror = 0\nfor k, v in sub_st.items():\n temp_error = 0\n for history in v:\n temp_error += 1\n if 'AC' in v:\n error += temp_error\n solved += 1\n break\n\npriny(solved, error)\n ", "N, M = map(int, input().split())\ndid_ac = [False] * N\npn_cnt = [0] * N\nfor _ in range(M):\n p, s = input().split()\n p = int(p) - 1\n if did_ac[p]:\n continue\n s = s == 'AC'\n if s:\n did_ac[p] = True\n else:\n pn_cnt[p] += 1\nprint(sum(did_ac), sum(pn_cnt[i] for i in range(N) if did_ac[i]))\n"]
['Wrong Answer', 'Runtime Error', 'Accepted']
['s375408361', 's997173517', 's683469359']
[51388.0, 49160.0, 4596.0]
[2106.0, 373.0, 290.0]
[429, 409, 323]
p02802
u890461092
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["n,m = list(map(int,input().split()))\nac = 0\nwa = 0\ny = [0] * n\nz = [0] * n\n\nfor _ in range(m):\n p,s = input().split()\n p = int(p)\n if not y[p] and s == 'WA':\n z[p] += 1\n elif not y[p] and s == 'AC':\n ac += 1\n y[p] += 1\n\nfor i in range(m):\n if y[i]:\n wa += z[i]\n\nprint(ac,wa)", "n,m = list(map(int,input().split()))\nac = 0\nwa = 0\ny = {i:0 for i in range(1,n+1)}\nz = {i:0 for i in range(1,n+1)}\n\nfor _ in range(m):\n p,s = input().split()\n p = int(p)\n if not y[p] and s == 'WA':\n z[p] += 1\n elif not y[p] and s == 'AC':\n ac += 1\n y[p] += 1\n\nfor i in range(1,n+1):\n if y[i]:\n wa += z[i]\n\nprint(ac,wa)"]
['Runtime Error', 'Accepted']
['s962323773', 's256533167']
[4596.0, 27368.0]
[267.0, 358.0]
[291, 335]
p02802
u890485928
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n, m = map(int, input().split())\np = [list(input().split()) for _ in range(m)]\n\nac = 0\nwa = 0\nprob = 0\n\nfor i in range(m):\n if p[i][0] != prob:\n if p[i][1] == "WA":\n wa += 1\n elif p[i][1] == "AC":\n ac += 1\n prob = p[i][0]\n \nprint(ac, wa', 'n, m = map(int, input().split())\np = [list(input().split()) for _ in range(m)]\n\nac = 0\nwa = 0\nprob = 0\n\nfor i in range(m):\n if int(p[i][0]) != prob:\n if p[i][1] == "WA":\n wa += 1\n elif p[i][1] == "AC":\n ac += 1\n prob = p[i][0]\n \nprint(ac, wa)', 'n, m = map(int, input().split())\nac = 0\nwa = 0\n\nac_tf = [0] * n\nwa_num = [0] * n\n\nfor i in range(m):\n p, s = input().split()\n p = int(p) - 1\n if s == "AC":\n if ac_tf[p] == 0:\n ac += 1\n wa += wa_num[p]\n ac_tf[p] = 1\n else:\n wa_num[p] += 1\n \nprint(ac, wa)\n\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s804946953', 's889383080', 's495911784']
[3064.0, 25944.0, 4596.0]
[17.0, 286.0, 287.0]
[297, 303, 325]
p02802
u893270619
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["N, M = map(int, input().split())\nL = []\nfor i in range(M):\n L += [input().split()]\n\ncnt_WA = 0\ncnt_AC = 0\nj0 = 0\nfor j, k in L:\n if (cnt_AC == N) or (j0 == j):\n break\n if k == 'WA':\n cnt_WA += 1\n if k == 'AC':\n cnt_AC += 1\n j0 = j\nprint(cnt_AC, cnt_WA)", "from collections import defaultdict\nN, M = map(int, input().split())\nL = []\nfor i in range(M):\n L += [input().split()]\n\nWA = defaultdict(lambda: 0)\ncnt_AC = 0\nalr = set()\nfor j, k in L:\n j = int(j)\n if j in alr:\n continue\n if k == 'AC':\n cnt_AC += 1\n alr.add(int(j))\n else:\n WA[j] += 1\n\nprint(cnt_AC, sum(WA[l] for l in alr))"]
['Wrong Answer', 'Accepted']
['s616096042', 's221281720']
[32204.0, 52008.0]
[263.0, 354.0]
[266, 342]
p02802
u910632349
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m=map(int,input().split())\na=[(0,0) for _ in range(n+1)]\nx=[]\nfor i in range(m):\n x.append(list(input().split()))\n x[i][0]=int(x[i][0])\nfor i in range(m):\n if x[i][1]=="AC":\n a[x[i][0]][1]=1\n else:\n if a[x[i][0]][1]==1:\n continue\n else:\n a[x[i][0]][0]+=1\nc=0\nd=0\nfor i in range(n+1):\n c+=a[i][1]\n if a[i][1]:\n d+=a[i][0]\nprint(c,d)', 'n,m=map(int,input().split())\na=[[0,0] for _ in range(n+1)]\nx=[]\nfor i in range(m):\n x.append(list(input().split()))\n x[i][0]=int(x[i][0])\nfor i in range(m):\n if x[i][1]=="AC":\n a[x[i][0]][1]=1\n else:\n if a[x[i][0]][1]==1:\n continue\n else:\n a[x[i][0]][0]+=1\nc=0\nd=0\nfor i in range(n+1):\n c+=a[i][1]\n if a[i][1]:\n d+=a[i][0]\nprint(c,d)']
['Runtime Error', 'Accepted']
['s974590950', 's404413785']
[27904.0, 35908.0]
[207.0, 321.0]
[401, 401]
p02802
u912867658
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N,M = input().split()\nl = [0]*int(N) #flg\nm = [0]*int(N) #counter\nc =0\n\nfor i in range(int(M)+1):\n p,s = input().split()\n if s =="AC":\n if l[int(p)-1]==1:\n pass\n else:\n l[int(p)-1] = 1\n c += m[int(p)-1]\n elif s == "WA":\n m[int(p)-1] += 1\n\n\n\nprint(l.count(1),c)\n\n\n\n', 'N,M = input().split()\nl = [0]*int(N) #flg\nm = [0]*int(N) #counter\nc =0\n\nfor i in range(int(M)):\n p,s = input().split()\n if s =="AC":\n if l[int(p)-1]==1:\n pass\n else:\n l[int(p)-1] = 1\n c += m[int(p)-1]\n elif s == "WA":\n m[int(p)-1] += 1\n\n\n\nprint(l.count(1),c)\n\n\n\n\n']
['Runtime Error', 'Accepted']
['s452853906', 's084838162']
[4596.0, 4596.0]
[312.0, 314.0]
[327, 326]
p02802
u919730120
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["n,m= map(int,input().split())\ncnt=0\nacc=0\nac=[0]*n\nfor i in range(m):\n\tp,s= map(str,input().split())\n\tif ac[int(p)]==0:\n\t\tif s=='AC':\n\t\t\tacc+=1\n\t\t\tac[int(p)]=1\n\t\telse:\n\t\t\tcnt+=1\nprint(acc,cnt)", "n,m= map(int,input().split())\ncnt=0\nacc=0\nac=[0]*n\nfor i in range(m):\n\tp,s= map(str,input().split())\n\tif ac[int(p)]==0:\n\t\tif s=='AC':\n\t\t\tacc+=1\n\t\t\tac[int(p)]=1\n\t\telse:\n\t\t\tcnt+=1\nprint(acc,cnt)", "n,m=map(int,input().split())\ncnt=0\nacc=0\nac={}\nfor i in range(m):\n\tp,s= map(str,input().split())\n\tif ac[p]==0:\n\t\tif s=='AC':\n\t\t\tacc+=1\n\t\t\tac[p]=1\n\t\telse:\n\t\t\tcnt+=1\nprint(acc,cnt)", "import sys\ninput = sys.stdin.readline\n\ndef main():\n n,m=map(int,input().split())\n w=[0]*(n+1)\n a=[0]*(n+1)\n for i in range(m):\n p,s=map(str,input().split())\n p=int(p)\n if a[p]==0:\n if s=='WA':\n w[p]+=1\n else:\n a[p]=1\n wa=0\n for i in range(1,n+1):\n wa=wa+a[i]*w[i]\n print(sum(a),wa)\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s147785356', 's165007365', 's743811843', 's190900550']
[3828.0, 3828.0, 3060.0, 4596.0]
[322.0, 332.0, 17.0, 153.0]
[192, 192, 178, 421]
p02802
u934052933
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['def main():\n N, M= map(int, input().split())\n \n acList = [False] * N\n waList = [0] * N\n waCount = 0\n\n for _ in range(M):\n p, s = map(str, input().split())\n p = int(p) - 1\n if atList[p]:\n continue\n if s == "WA":\n waList[p] += 1\n continue\n waCount += waList[p]\n acList[p] = True\n\n print(sum(acList), waCount)\n\nif __name__ == "__main__":\n main()', 'def main():\n N, M= map(int, input().split())\n \n acList = [False] * N\n waList = [0] * N\n waCount = 0\n\n for _ in range(M):\n p, s = map(str, input().split())\n p = int(p) - 1\n if acList[p]:\n continue\n if s == "WA":\n waList[p] += 1\n continue\n waCount += waList[p]\n acList[p] = True\n\n print(sum(acList), waCount)\n\nif __name__ == "__main__":\n main()']
['Runtime Error', 'Accepted']
['s220714278', 's366077603']
[4596.0, 4596.0]
[19.0, 308.0]
[441, 441]
p02802
u934788990
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = map(int,input().split())\nquest = []\nif m == 0:\n pass\nelse:\n for i in range(m):\n a,b=input().split()\n quest.append([int(a), b])\nwa = 0\nac = 0\nans = [0]*n\nfor j in range(m):\n if quest[j][1] == "AC":\n if ans[int(quest[j][0]-1)] != 1:\n ac += 1\n ans[int(quest[j][0]-1)] = 1\n else:\n if ans[int(quest[j][0]-1)] == 1:\n pass\n else:\n wa+=1', 'n,m=map(int,input().split())\nj=[0]*n\nc=[0]*n\nwa=0\nac=0\nfor i in range(m):\n p,s=input().split()\n p=int(p)-1\n if s[0]=="A" and j[p]==0:\n j[p]=1\n ac+=1\n wa+=c[p]\n elif s[0]=="W":c[p]+=1\nprint(ac,wa)']
['Wrong Answer', 'Accepted']
['s947278973', 's256819344']
[22696.0, 4596.0]
[338.0, 284.0]
[417, 228]
p02802
u936755756
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = map(int, input().split())\n\nno = 0\ncorrect = 0\npenalty = 0\n\nfor i in range(m):\n p,s = input().split()\n p = int(p)\n\n if p > no:\n if s == "WA":\n penalty += 1\n elif s == "AC":\n correct += 1\n no = p + 1 \n\nprint(correct, penalty)', 'n,m = map(int, input().split())\n\nsolved = set()\ncorrect = 0\npenalty = 0\npenalty_memo = [0] * (n+1)\n\nfor _ in range(m):\n p,s = input().split()\n p = int(p)\n\n if p not in solved:\n if s == "WA":\n penalty_memo[p] += 1\n else:\n correct += 1\n penalty += penalty_memo[p]\n solved.add(p)\n\nprint(correct, penalty)']
['Wrong Answer', 'Accepted']
['s441163065', 's183792949']
[3060.0, 12652.0]
[250.0, 300.0]
[285, 368]
p02802
u937950774
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['def main():\n N, M = list(map(int, input().split()))\n inputs = [input().split() for i in range(M)]\n \n inputs = inputs.split()\n inputs = [[inputs[i], inputs[i + 1]] for i in range(0, len(inputs), 2)]\n print(inputs)\n has_been_solved = set()\n\n penalty = 0\n correct = 0\n for i in inputs:\n num = int(i[0])\n if num not in has_been_solved and i[1] == \'AC\':\n has_been_solved.add(num)\n elif num not in has_been_solved and i[1] != \'AC\':\n penalty += 1\n correct = len(has_been_solved)\n \n print(correct, penalty) \n \n\nif __name__ == "__main__":\n main()\n', 'def main():\n # N, M = list(map(int, input().split()))\n \n with open(\'./abc151/test.txt\', \'r\') as f:\n inputs = f.read()\n f.close()\n inputs = inputs.split()\n inputs = [[inputs[i], inputs[i + 1]] for i in range(0, len(inputs), 2)]\n print(inputs)\n has_been_solved = set()\n\n penalty = 0\n correct = 0\n for i in inputs:\n num = int(i[0])\n if num not in has_been_solved and i[1] == \'AC\':\n has_been_solved.add(num)\n elif num not in has_been_solved and i[1] != \'AC\':\n penalty += 1\n correct = len(has_been_solved)\n \n print(correct, penalty) \n \n\nif __name__ == "__main__":\n main()\n', 'import sys\n\ndef main():\n N, M = list(map(int, input().split()))\n \n inputs = [input().split() for i in range(M)]\n has_been_solved = set()\n\n penalty = {}\n correct = 0\n\n for i in inputs:\n \n num = int(i[0])\n if num in has_been_solved:\n continue\n\n if i[1] == \'AC\':\n correct += 1\n has_been_solved.add(num)\n else:\n if num not in penalty:\n penalty[num] = 1\n else:\n penalty[num] += 1\n print(correct, sum([penalty[p] for p in already])) \n \n\nif __name__ == "__main__":\n main()\n', 'import sys\n\ndef main():\n N, M = list(map(int, input().split()))\n inputs = [input().split() for i in range(M)]\n \n has_been_solved = set()\n\n penalty = 0\n correct = 0\n for i in sys.stdin:\n num = int(i[0])\n if num in has_been_solved:\n continue\n\n if i[1] == \'AC\':\n has_been_solved.add(num)\n else:\n penalty += 1\n correct = len(has_been_solved)\n \n print(correct, penalty) \n \n\nif __name__ == "__main__":\n main()\n', "n,m=map(int,input().split())\na=[0]*n\nw=[0]*n\nac=0\nwc=0\nfor _ in range(m):\n p,s=input().split()\n p=int(p)-1\n if a[p]==0:\n if s=='AC':\n a[p]=1\n ac+=1\n wc+=w[p]\n else:\n w[p]+=1\nprint(ac,wc)\n"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s306828020', 's380034880', 's590948409', 's661033161', 's497360252']
[32144.0, 3064.0, 41104.0, 32144.0, 4596.0]
[218.0, 17.0, 257.0, 195.0, 300.0]
[641, 730, 629, 516, 254]
p02802
u939585142
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N, M = map(int,input().split())\n\na = 0\np = 0\nm = 0\nfor i in range(M):\n P, S = input().split()\n P = int(P)\n if S == "AC" and m != P:\n a += 1\n m = P\n if S == "AC" and m == P:\n continue\n else:\n p += 1\n\nprint(a,p)', 'N, M = map(int,input().split())\n\nif M == 0:\n print(0,0)\n exit()\n \na = [0]*(N + 1)\np = [0]*(N + 1)\nwa = [0]*(N + 1)\n\nfor i in range(M):\n P, S = input().split()\n P = int(P)\n if S == "WA":\n wa[P] += 1\n elif a[P] == 0:\n a[P] += 1\n p[P] = wa[P]\n\nprint(sum(a),sum(p))']
['Wrong Answer', 'Accepted']
['s966428243', 's956627108']
[3064.0, 5364.0]
[253.0, 277.0]
[226, 277]
p02802
u941284420
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, M: int, p: "List[int]", S: "List[str]"):\n wa_flag = [0]*N\n num_penalty = 0\n for i in range(M):\n pi = p[i]\n si = S[i]\n if wa_flag[pi-1] == 0 and si == "WA":\n num_penalty += 1\n if si == "AC":\n wa_flag = -1\n num_ac = wa_flag.count(-1)\n print(num_ac, num_penalty)\n# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n N = int(next(tokens)) # type: int\n M = int(next(tokens)) # type: int\n p = [int()] * (M) # type: "List[int]"\n S = [str()] * (M) # type: "List[str]"\n for i in range(M):\n p[i] = int(next(tokens))\n S[i] = next(tokens)\n solve(N, M, p, S)\n\nif __name__ == \'__main__\':\n main()\n', '#!/usr/bin/env python3\nimport sys\n\n\ndef solve(N: int, M: int, p: "List[int]", S: "List[str]"):\n wa_flag = [0] * N\n num_penalty = 0\n for i in range(M):\n if S[i] == "WA":\n if wa_flag[p[i]-1] != -1:\n wa_flag[p[i]-1] += 1\n else:\n if wa_flag[p[i]-1] != -1:\n num_penalty += wa_flag[p[i]-1]\n wa_flag[p[i]-1] = -1\n num_ac = wa_flag.count(-1)\n print(num_ac, num_penalty)\n# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n N, M = map(int, input().split())\n p = [None] * M\n S = [None] * M\n for i in range(M):\n pi, si = input().split()\n p[i] = int(pi)\n S[i] = str(si)\n solve(N, M, p, S)\n\nif __name__ == \'__main__\':\n main()\n']
['Runtime Error', 'Accepted']
['s936960323', 's856421155']
[14108.0, 14068.0]
[119.0, 262.0]
[1018, 874]
p02802
u941438707
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m=map(int,input().split())\nac=[0]*(n+1)\nwa=[0]*(n+1)\nfor _ in range(m):\n i,j=input().split()\n i=int(i)\n if j=="AC":\n ac[i]=1\n elif ac[i]==0 and j=="WA":\n wa[i]+=1\nprint(sum(ac),sum(wa[i] for i in range(n) if ac[i]==1)) ', 'n,m=map(int,input().split())\nac=[0]*(n+1)\nwa=[0]*(n+1)\nfor _ in range(m):\n i,j=input().split()\n i=int(i)\n if j=="AC":\n ac[i]=1\n elif ac[i]==0 and j=="WA":\n wa[i]+=1\nprint(sum(ac),sum(wa[i] for i in range(m) if ac[i]==1)) ', 'n,m=map(int,input().split())\nac=[0]*(n+1)\nwa=[0]*(n+1)\nfor _ in range(m):\n i,j=input().split()\n i=int(i)\n if j=="AC":\n ac[i]=1\n elif ac[i]==0 and j=="WA":\n wa[i]+=1\nprint(sum(ac),sum(wa[i] for i in range(n+1) if ac[i]==1)) ']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s221147860', 's388777608', 's139039253']
[4596.0, 4596.0, 4596.0]
[281.0, 289.0, 288.0]
[252, 250, 250]
p02802
u942051624
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["N,M=map(int,input().split())\nacs=[0 for i in range(N)]\nwa=[0 for i in range(N)]\n\nfor i in range(M):\n p,S=map(str,input().split())\n p=int(p)\n if S=='AC':\n acs[p-1]=1\n elif S=='WA' and acs[p-1]==0: \n wa[p-1]+=1\nfor i in range(M):\n if acs[i]==0:\n wa[i]=0\nans=[sum(acs),sum(wa)]\n", "N,M=map(int,input().split())\nacs=[0 for i in range(N)]\nwa=[0 for i in range(N)]\n\nfor i in range(M):\n p,S=map(str,input().split())\n p=int(p)\n if S=='AC':\n acs[p-1]=1\n elif S=='WA' and acs[p-1]==0: \n wa[p-1]+=1\nfor i in range(N):\n if acs[i]==0:\n wa[i]=0\nans=[sum(acs),sum(wa)]\n", "N,M=map(int,input().split())\nacs=[0 for i in range(N)]\nwa=[0 for i in range(N)]\n\nfor i in range(M):\n p,S=map(str,input().split())\n p=int(p)\n if S=='AC':\n acs[p-1]=1\n elif S=='WA' and acs[p-1]==0: \n wa[p-1]+=1\nfor i in range(N):\n if acs[i]==0:\n wa[i]=0\nans=[sum(acs),sum(wa)]\nprint(*ans)"]
['Runtime Error', 'Wrong Answer', 'Accepted']
['s234298460', 's795952029', 's693307517']
[10744.0, 10700.0, 10796.0]
[230.0, 245.0, 237.0]
[312, 312, 323]
p02802
u943057856
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = map(int,input().split())\na=[0]*n\nw=[0]*n\nac=0\nwa=0\nfor _ in range(m):\n p,s=input().split()\n p=int(p)-1\n if a[p]==0:\n if s=="AC":\n a[p]=1\n ac+=1\n wc+=w[p]\n else:\n w[p]+=1\nprint(ac,wc)', 'n,m = map(int,input().split())\na=[0]*n\nw=[0]*n\nac=0\nwc=0\nfor _ in range(m):\n p,s=input().split()\n p=int(p)-1\n if a[p]==0:\n if s=="AC":\n a[p]=1\n ac+=1\n wc+=w[p]\n else:\n w[p]+=1\nprint(ac,wc)']
['Runtime Error', 'Accepted']
['s336918524', 's030609263']
[4596.0, 4596.0]
[266.0, 294.0]
[255, 255]
p02802
u944643608
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["N,M = map(int,input().split())\nAC = 0\nWA = 0\nlis = [0] * N\nfor i in range(M):\n a,b = map(input().split())\n if lis[int(a)-1] < 0:\n pass\n elif b == 'AC':\n WA += lis[int(a)-1]\n AC += 1\n lis[int(a)-1] = -1\n else:\n lis[int(a)-1] += 1\nprint(AC, WA)\n", "N,M = map(int,input().split())\nAC = 0\nWA = 0\nlis = [0] * N\nfor i in range(M):\n a,b = map(input().split())\n if lis[int(a)-1] < 0:\n pass\n elif b == 'AC'\n WA += lis[int(a)-1]\n AC += 1\n lis[int(a)-1] = -1\n else:\n lis[int(a)-1] += 1\nprint(AC, WA)", "N,M = map(int,input().split())\nAC = 0\nWA = 0\nlis = [0] * N\nfor i in range(M):\n a,b = input().split()\n if lis[int(a)-1] < 0:\n pass\n elif b == 'AC':\n WA += lis[int(a)-1]\n AC += 1\n lis[int(a)-1] = -1\n else:\n lis[int(a)-1] += 1\nprint(AC, WA)\n"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s784033034', 's873917494', 's745437729']
[3828.0, 2940.0, 3956.0]
[18.0, 17.0, 322.0]
[262, 260, 257]
p02802
u947327691
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m=map(int,input().split())\n\nac_cnt=0\nwa_cnt=0\nflag=0\nno=-1\n\nfor i in range(m):\n a,b=input().split()\n if flag == 1 and no!= a:\n flag=0\n else:\n if flag == 0 and b == "WA":\n wa_cnt += 1\n elif flag == 0 and b == "AC":\n ac_cnt += 1\n flag += 1\n no=a\n else:\n continue\n\nprint(ac_cnt,wa_cnt)', 'n,m=map(int,input().split())\n\nac_cnt=0\nwa_cnt=0\nflag=0\nno=-1\n\nfor i in range(m):\n a,b=input().split()\n if flag == 1 and no!= a:\n flag=0\n else:\n if flag == 0 and b == "WA":\n wa_cnt += 1\n elif flag == 0 and b == "AC":\n ac_cnt += 1\n flag += 1\n no=a\n\nprint(ac_cnt,wa_cnt)', 'n,m=map(int,input().split())\n\nac_cnt=[False]*n\nwa_cnt=[0]*n\n\nfor _ in range(m):\n a,b=input().split()\n a=int(a)-1\n if b == "AC":\n ac_cnt[a] = True\n else:\n if ac_cnt[a] == False:\n wa_cnt[a] += 1\n\nprint(ac_cnt)\nc=0\nd=0\n\nfor i in range(n):\n if ac_cnt[a]:\n c += 1\n d += wa_cnt[i]\n\nprint(c,d)', 'n,m=map(int,input().split())\n\nac_cnt=[False]*n\nwa_cnt=[0]*n\n\np=int(p-1)\n\nfor _ in range(m):\n a,b=input().split()\n if b == "AC":\n ac_cnt[a] == True\n else:\n if ac_cnt[a] == False:\n wa_cnt[a] += 1\na=0\nb=0\n\nfor i in range(n):\n if ac_cnt[a]:\n a += 1\n b += wa_cnt[i]\n\nprint(a,b)', 'n,m=map(int,input().split())\n\nl = [list(input().split()) for _ in range(m)]\nwa_cnt = 0\nac_cnt=0\nflag=0\n\nfor i in range(m):\n if i == 0 or l[i-1][0]==l[i][0]:\n if l[i][1]=="WA" and flag==0:\n wa_cnt += 1\n else:\n ac_cnt += 1\n flag = 1\n else:\n flag=0\n if l[i][1]=="WA" and flag==0:\n wa_cnt += 1\n else:\n ac_cnt += 1\n flag = 1\n\nprint(ac_cnt,wa_cnt)', 'n,m=map(int,input().split())\n\nac_cnt=[False]*n\nwa_cnt=[0]*n\n\nfor _ in range(m):\n a,b=input().split()\n a=int(a)-1\n if b == "AC":\n ac_cnt[a] = True\n else:\n if ac_cnt[a] == False:\n wa_cnt[a] += 1\nc=0\nd=0\n\nfor i in range(n):\n if ac_cnt[i]:\n c += 1\n d += wa_cnt[i]\n\nprint(c,d)']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s092335906', 's127025208', 's185703641', 's597331287', 's707850768', 's205894768']
[2940.0, 3064.0, 6640.0, 4596.0, 25944.0, 4596.0]
[17.0, 214.0, 287.0, 19.0, 269.0, 271.0]
[368, 341, 340, 323, 448, 325]
p02802
u951425592
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['import numpy as np\n\nN,M = map(int,input().split())\n\nnumAC = [0]*N\nnumWA = [0]*N\nflgAC = [0]*N\n\n#print(num)\n\nfor ii in range(M):\n pi,Si = input().split()\n pi = int(pi)\n \n if flgAC[pi] == 0:\n if Si == "AC":\n numAC[pi] = 1\n flgAC[pi] = 1\n elif Si == "WA":\n numWA[pi] += 1\n\nprint(np.sum(numAC),np.sum(numWA))', 'import numpy as np\n\nN,M = map(int,input().split())\n\n#numAC = [0]*N\nnumWA = [0]*N\nflgAC = [0]*N\n\n#print(num)\n\nfor ii in range(M):\n pi,Si = input().split()\n pi = int(pi) - 1 \n \n if flgAC[pi] == 0:\n if Si == "AC":\n #numAC[pi] = 1\n flgAC[pi] = 1\n elif Si == "WA":\n numWA[pi] += 1\n\ncountWA = 0\nfor ii in range(N):\n if flgAC == 1:\n countWA += numWA[ii]\nprint(np.sum(flgAC),countWA)\n', 'import numpy as np\n\nN,M = map(int,input().split())\n\n#numAC = [0]*N\nnumWA = [0]*N\nflgAC = [0]*N\n\n#print(num)\n\nfor ii in range(M):\n pi,Si = input().split()\n pi = int(pi) - 1 \n \n if flgAC[pi] == 0:\n if Si == "AC":\n #numAC[pi] = 1\n flgAC[pi] = 1\n elif Si == "WA":\n numWA[pi] += 1\n\ncountWA = 0\nfor ii in range(N):\n if flgAC[ii] == 1:\n countWA += numWA[ii]\nprint(np.sum(flgAC),countWA)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s465378579', 's693899919', 's131600691']
[15568.0, 14796.0, 16076.0]
[428.0, 427.0, 431.0]
[329, 440, 444]
p02802
u952669998
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['s = input().rstrip().split()\nN,M = int(s[0]),int(s[1])\n\na=[]\nfor i in range(M):\n a.append(input().rstrip().split())\n\npen =0\nAClist =[]\nACflag= [0]*N\n#print(a,len(a))\n\nfor i in range(len(a)):\n if a[i][1] == "AC" and ACflag[int(a[i][0])] == 0:\n AClist.append(a[i])\n ACflag[int(a[i][0])] = 1\n if a[i][1] == "WA" and ACflag[int(a[i][0])] == 0:\n pen += 1\n\nprint(len(AClist),pen)', 'N,M = list(map(int,input().split()))\n\nlac = [0]*(N+1)\nlpcnt = [0]*(N+1)\n\nfor i in range(M):\n s = input().split()\n n = int(s[0])\n if s[1] == "AC":\n lac[n] =1\n continue\n if s[1] == "WA" and lac[n] == 0:\n lpcnt[n] += 1\n\ncnt = 0\nfor i in range(N+1):\n if lac[i] == 1:\n cnt += lpcnt[i]\n \nprint(sum(lac), end=" ")\nprint(cnt)']
['Runtime Error', 'Accepted']
['s834507237', 's123352936']
[33768.0, 4596.0]
[295.0, 272.0]
[385, 335]
p02802
u953379577
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['x = int(input())\n\nans = 0\n\ndef prime(x):\n y = x//2+1\n cnt = 0\n for i in range(2,y+1):\n if x%i==0:\n cnt += 1\n \n if cnt == 0:\n return x\n else:\n return 0\n \nwhile ans == 0:\n ans = prime(x)\n x += 1\n \nif x == 2:\n print(2)\nelse:\n print(ans)', 'n,m = map(int,input().split())\n\npro = [0]*n\n\nac = set([])\n\nans = 0\n\npen = 0\n\nfor _ in range(m):\n l = input().split()\n s = l[1]\n p = int(l[0]) \n if s == "AC":\n if p not in ac:\n ans += 1\n pen += pro[p-1]\n ac.add(p)\n \n else:\n if p not in ac:\n pro[p-1] += 1\n \nprint(ans,pen)']
['Runtime Error', 'Accepted']
['s028497821', 's638411949']
[3060.0, 17984.0]
[17.0, 213.0]
[313, 368]
p02802
u953655640
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N, M = map(int, input().split())\nA = {}\nac = []\nfor i in range(M):\n p, s = map(str, input().split())\n if int(p) not in ac:\n if int(p) not in A.keys(): \n if int(p) >0 and int(p) <=N :\n if s == "WA":\n A[int(p)] =1\n elif s =="AC":\n A[int(p)] =0\n ac.append(int(p))\n elif int(p) in A.keys():\n if s == "WA":\n A[int(p)] +=1\n elif s =="AC":\n A[int(p)] +=0\n ac.append(int(p))\n \ntotal=0\ncount = 0\nfor k,v in A.items():\n if k in ac:\n count += 1\n total += v', 'N, M = map(int, input().split())\nA = {}\nac = []\nfor i in range(M):\n p, s = map(str, input().split())\n if int(p) not in ac:\n if int(p) not in A.keys(): \n if int(p) >0 and int(p) <=N :\n if s == "WA":\n A[int(p)] =1\n elif s =="AC":\n A[int(p)] =0\n elif int(p) in A.keys():\n if s == "WA":\n A[int(p)] +=1\n elif s =="AC":\n A[int(p)] +=0\n ac.append(int(p))\n \ntotal=0\ncount = 0\nfor k,v in A.items():\n if k in ac:\n count += 1\n total += i\nprint(count, total)', 'import numpy as np\nN, M = map(int, input().split())\nAC = np.array([0]*N)\nWA = np.array([0]*N)\n\nfor i in range(M):\n p, s = map(str, input().split())\n if AC[int(p)-1] == 0 and s =="WA":\n WA[int(p)-1] += 1\n else:\n AC[int(p)-1] = 1\n \n\nprint(sum(AC), sum(AC*WA))']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s656130569', 's657855287', 's376212872']
[9168.0, 15060.0, 14788.0]
[2104.0, 1469.0, 894.0]
[666, 648, 287]
p02802
u954153335
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["n,m=map(int,input().split())\np=[0]*m\ns=[0]*m\nfor i in range(m):\n pi,si=input().split()\n p[i]=int(pi)\n s[i]=si\njudge=[0]*(n+1)\nac=0\nwa=0\nfor i in range(m):\n if judge[p[i]]==-1:\n continue\n if judge[p[i]]==0:\n if s[i]=='WA':\n judge[p[i]]+=1\n else:\n wa+=judge[p[i]]\n judge[p[i]]=-1\n ac+=1\nprint(ac,wa)", "n,m=map(int,input().split())\np=[0]*m\ns=[0]*m\nfor i in range(m):\n pi,si=input().split()\n p[i]=int(pi)\n s[i]=si\njudge=[0]*(n+1)\nac=0\nwa=0\nfor i in range(m):\n if judge[p[i]]==-1:\n continue\n if judge[p[i]]!=-1:\n if s[i]=='WA':\n judge[p[i]]+=1\n else:\n wa+=judge[p[i]]\n judge[p[i]]=-1\n ac+=1\nprint(ac,wa)"]
['Wrong Answer', 'Accepted']
['s761192121', 's624259122']
[20288.0, 20756.0]
[223.0, 227.0]
[377, 378]
p02802
u955125992
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['from operator import itemgetter\n\n\nn, m = map(int, input().split())\n\nif m == 0:\n print(0)\n exit()\n\nl = []\nfor i in range(m):\n p, s = map(str, input().split())\n l.append([int(p), s])\nl.sort(key = itemgetter(0))\n\nnumAC = 0\nnumWA = 0\ncountWA = 0\nAC = False\nlast = l[0][0]\n\nfor i in range(m):\n if last == l[i][0]:\n if AC:\n continue\n elif l[i][1] == "AC":\n numAC += 1\n numWA += countWA\n AC = True\n else:\n countWA += 1\n else:\n last = l[i][0]\n AC = False\n if l[i][1] == "AC":\n numAC += 1\n AC = True\n else:\n countWA = 1', 'from operator import itemgetter\n\n\nn, m = map(int, input().split())\n\nif m == 0:\n print(0, 0)\n exit()\n\nl = []\nfor i in range(m):\n p, s = map(str, input().split())\n l.append([int(p), s])\nl.sort(key = itemgetter(0))\n\nnumAC = 0\nnumWA = 0\ncountWA = 0\nAC = False\nlast = l[0][0]\n\nfor i in range(m):\n if last == l[i][0]:\n if AC:\n continue\n elif l[i][1] == "AC":\n numAC += 1\n numWA += countWA\n AC = True\n else:\n countWA += 1\n else:\n last = l[i][0]\n AC = False\n if l[i][1] == "AC":\n numAC += 1\n AC = True\n else:\n countWA = 1\n\nprint(numAC, numWA)']
['Wrong Answer', 'Accepted']
['s947345184', 's317430768']
[23628.0, 23628.0]
[436.0, 454.0]
[665, 689]
p02802
u957843607
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N, M = map(int, input().split())\nans_num_lis = [0 for i in range(N)]\npre_ans_lis = [0 for i in range(N)]\nans_lis = [0 for i in range(N)]\nfor i in range(M):\n problem, result = input().split()\n problem_num = int(problem)\n if result == "WA":\n pre_ans_lis[problem_num] += 1\n if result == "AC" and not ans_num_lis[problem_num]:\n ans_num_lis[problem_num] = 1\n ans_lis[problem_num] = pre_ans_lis[problem_num]\n\nprint(sum(ans_num_lis), sum(ans_lis))', 'N, M = map(int, input().split())\nans_num_lis = [0 for i in range(N)]\npre_ans_lis = [0 for i in range(N)]\nans_lis = [0 for i in range(N)]\nfor i in range(M):\n problem, result = input().split()\n problem_num = int(problem)\n if result == "WA":\n pre_ans_lis[problem_num-1] += 1\n if result == "AC" and not ans_num_lis[problem_num-1]:\n ans_num_lis[problem_num-1] = 1\n ans_lis[problem_num-1] = pre_ans_lis[problem_num-1]\n\nprint(sum(ans_num_lis), sum(ans_lis))']
['Runtime Error', 'Accepted']
['s661769984', 's682449280']
[11404.0, 11384.0]
[193.0, 209.0]
[453, 463]
p02802
u958053648
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["N,M=map(int, input().split())\np=[0]*M\nS=['']*M\nfor i in range(M):\n\tp[i],S[i]=input().split()\nP=[int(s) for s in p]\na=0\nb=0\nc=0\nd=0\nfor j,k in zip(P,S):\n\tif d!=j:\n\t\tc=0\n\tif k=='AC':\n\t\tif c!=j:\n\t\t\ta+=1\n\t\t\tc+=j\n\t\telse:\n\t\t\tcontinue\n\telse:\n\t\tif c!=j:\n\t\t\tb+=1\n\td=j\nprint(a)\nprint(b)", "N,M=map(int, input().split())\np=[0]*M\nS=['']*M\nfor i in range(M):\n\tp[i],S[i]=input().split()\nP=[int(s) for s in p]\na=0\nb=0\nc=0\nd=0\nfor j,k in zip(P,S):\n\tif d!=j:\n\t\tc=0\n\telse:\n\t\tc=c\n\tif k=='AC':\n\t\tif c!=j:\n\t\t\ta+=1\n\t\t\tc+=j\n\t\telse:\n\t\t\tcontinue\n\telse:\n\t\tif c!=j:\n\t\t\tb+=1\n\td=j\nprint(a)\nprint(b)", "n,m = map(int,input().split())\nWA = [0]*n\nAC = [0]*n\nwa = 0\nfor i in range(m):\n x = input().split()\n x[0] = int(x[0])\n if x[1] == 'WA' and AC[x[0]-1] == 0:\n WA[x[0]-1] += 1\n elif x[1] == 'AC' and AC[x[0]-1] == 0:\n AC[x[0]-1] += 1\n wa += WA[x[0]-1]\nprint(sum(AC),wa) "]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s252800907', 's966636938', 's178531565']
[19860.0, 19760.0, 4596.0]
[256.0, 245.0, 297.0]
[276, 289, 301]
p02802
u962423738
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m=map(int,input().split())\nwa=0\nac=0\ncheck = [0]*n\nfor _ in range(m):\n\ta, b = input().split()\n i = int(a)\n\tif check[i]==0:\n\t\tif b == "WA":\n\t\t\twa+=1\n\t\telif b == "AC":\n\t\t\tac+=1\n\t\t\tcheck[i]=1\nprint(ac,wa)', 'n,m=map(int,input().split())\nwa=0\nac=0\nflag=0\nfor _ in range(m):\n\ta, b = input().split()\n\tif flag == 0:\n\t\tif b == "WA":\n\t\t\twa+=1\n\t\telse:\n\t\t\tac+=1\n\t\t\tflag=1\nprint(ac,wa)', 'n,m=map(int,input().split())\nwa=0\nac=0\ncheck = [0]*n\nfor _ in range(m):\n\ta, b = input().split()\n\tif check[int(a)]==0:\n\t\tif b == "WA":\n\t\t\twa+=1\n\t\telif b == "AC":\n\t\t\tac+=1\n\t\t\tcheck[int(a)]=1\nprint(ac,wa)', 'n,m=map(int,input().split())\nwa=0\nac=0\ncheck=0\nfor _ in range(m):\n a, b = input().split()\n if int(a) == check:\n if b =="WA":\n wa+=1\n else:\n ac+=1\n check=int(a)\nprint(ac,wa)', 'n,m=map(int,input().split())\nwa=0\nac=0\ncheck = [0]*n\nfor _ in range(m):\n\ta, b = input().split()\n\ti = int(a)\n\tif check[i]==0:\n\t\tif b == "WA":\n\t\t\twa+=1\n\t\telif b == "AC":\n\t\t\tac+=1\n\t\t\tcheck[i]=1\nprint(ac,wa)', 'n,m=map(int,input().split())\nwa=0\nac=0\ncheck = [0]*n\nfor _ in range(m):\n\ta, b = input().split()\n\tif check[int(a)]==0:\n\t\tif b == "WA":\n\t\t\twa+=1\n\t\telif b == "AC":\n\t\t\tac+=1\n\t\t\tcheck[int(a)]=1\nprint(ac,wa)', "N, M = map(int, input().split())\n\nac = [False] * N\nwa = [0] * N\nfor _ in range(M):\n p, S = input().split()\n p = int(p) - 1\n if S == 'AC':\n ac[p] = True\n else:\n if not ac[p]:\n wa[p] += 1\n\na = 0\nb = 0\nfor i in range(N):\n if ac[i]:\n a += 1\n b += wa[i]\nprint(*[a, b])"]
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s144742962', 's325398330', 's596171017', 's684363469', 's836277610', 's959964394', 's713821117']
[8912.0, 9120.0, 9576.0, 9128.0, 9588.0, 9604.0, 10256.0]
[26.0, 150.0, 187.0, 158.0, 173.0, 189.0, 189.0]
[206, 168, 201, 215, 203, 201, 317]
p02802
u963128036
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['# coding: utf-8\n\nn,m = map(int,input().split())\nac = wa = wa_another = 0\np_list = []\n\nfor i in range(m):\n P,s = map(str,input().split())\n p = int(P)\n\n if s == "WA":\n if not p in p_list:\n wa_another += 1\n else:\n wa += 1\n\n \n if (s == "AC") and (not p in p_list):\n ac += 1\n wa += wa_another\n wa_another = 0\n p_list.append(p)\n\nprint(ac,wa)', '# coding: utf-8\n\nimport sys\ninput = sys.stdin.readline\n\nn, m = map(int, input().split())\n\nac_set = set()\npenalty = 0\nwa_count = [0] * (n+1)\n\nfor i in range(m):\n p, s = input().split()\n p = int(p)\n\n if s == "AC":\n if not p in ac_set:\n penalty += wa_count[p]\n ac_set.add(p)\n elif s == "WA":\n wa_count[p] += 1\n\n\nprint(len(ac_set), penalty)']
['Wrong Answer', 'Accepted']
['s383413671', 's287272389']
[3700.0, 12780.0]
[2104.0, 130.0]
[414, 384]
p02802
u968404618
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["n, m = map(int, input().split())\nA = [list(map(str, input().split())) for _ in range(m)]\n\nans = 0\npen = 0\n\nA = list(map(list, set(map(tuple, A))))\n\nfor i in range(len(A)):\n if A[i][1]=='AC':\n ans += 1\n print(A[i])\n if i+1<=len(A)-1 and A[i+1] == (''.format(i), 'WA'):\n A.remove(A[i+1])\n if A[i][1] == 'WA':\n pen += 1\n\nprint(ans, pen)", "n, m = map(int, input().split())\n\nac = [0]*n\nwa = [0]*n\n\nfor _ in range(m):\n p, s = map(str, input().split())\n p = int(p)\n\n if ac[p-1]:\n continue\n else:\n if s == 'AC':\n ac[p-1] = 1\n else:\n wa[p-1] += 1\n\nAC = 0\nWA = 0\nfor i in range(n):\n AC += ac[i]\n if ac[i]:\n WA += wa[i]\n\nprint(AC, WA)"]
['Wrong Answer', 'Accepted']
['s704822903', 's261429179']
[49680.0, 4596.0]
[650.0, 355.0]
[376, 355]
p02802
u969211566
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = map(int,input().split())\nps = [input().split() for _ in range(m)]\n\n\nanswer =["inf"]*m\ncount = 0\n\nfor i in range(len(ps)):\n if ps[i][0] not in answer:\n if ps[i][1] == "AC":\n answer[i] = ps[i][0]\n else:\n count += 1\nanswer.remove("inf")\nprint(len(answer),count)', "n, m = map(int, input().split())\nac = 0\nwa = 0\ncnt = [0]*n\n\nfor i in range(m):\n p, s = input().split()\n p = int(p)\n p -= 1\n if cnt[p] == -1:\n continue\n elif s == 'AC':\n ac += 1\n wa += cnt[p]\n cnt[p] = -1\n else:\n cnt[p] += 1\nprint(ac, wa)"]
['Runtime Error', 'Accepted']
['s444413140', 's909351638']
[32908.0, 3828.0]
[2106.0, 288.0]
[281, 290]
p02802
u970109776
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['coding: utf-8\n\nimport bisect\nimport math\n\nN, M = (int(v) for v in input().split())\n\nseen = {}\nWA = {}\n\nacs = 0\nwas = 0\n\nfor i in range(M):\n q, tmp = input().split()\n if tmp == "AC":\n if q not in seen:\n acs += 1\n if q not in WA:\n WA[q] = 0\n was += WA[q]\n seen[q] = 1\n else:\n if q not in WA:\n WA[q] = 1\n else:\n WA[q] += 1\n\nprint (acs, was)\n\n', '#coding: utf-8\n\nimport bisect\nimport math\n\nN, M = (int(v) for v in input().split())\n\nseen = {}\nWA = {}\n\nacs = 0\nwas = 0\n\nfor i in range(M):\n q, tmp = input().split()\n if tmp == "AC":\n if q not in seen:\n acs += 1\n if q not in WA:\n WA[q] = 0\n was += WA[q]\n seen[q] = 1\n else:\n if q not in WA:\n WA[q] = 1\n else:\n WA[q] += 1\n\nprint (acs, was)\n\n']
['Runtime Error', 'Accepted']
['s267812216', 's299353062']
[2940.0, 23560.0]
[17.0, 281.0]
[450, 451]
p02802
u971096161
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["n,m = map(int, input().split())\nnum_ac = 0\nnum_wa = 0\ntmp_num_wa = 0\nanswerd = []\n\nfor i in range(m):\n p,s = input().split()\n if p in answerd:\n continue\n if s == 'WA':\n tmp_num_wa += 1\n if s == 'AC':\n num_ac += 1\n num_wa += tmp_num_wa\n tmp_num_wa = 0\n answerd.append(_p)\n \nprint(num_ac, num_wa)", "n,m = map(int, input().split())\nac = [0]*n\nwa = [0]*n\n\nfor i in range(m):\n p,s = input().split()\n p = int(p)-1\n if s == 'AC':\n ac[p] = 1\n elif s == 'WA':\n if ac[p] == 0:\n wa[p] += 1\n\nnum_ac = 0\nnum_wc = 0\n\nfor a, w in zip(ac,wa):\n num_ac += a\n if a > 0:\n num_wc += w \nprint(num_ac,num_wc)"]
['Runtime Error', 'Accepted']
['s761133578', 's535404270']
[3064.0, 4596.0]
[208.0, 282.0]
[319, 310]
p02802
u972652761
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['import numpy as np\nn,p = map(int,input().split())\nac = np.array([0]*n)\nwa = np.array([0]*n)\n\nfor i in range(N):\n p,s = input().split()\n if ac[int(p) - 1] == 0 and s == "WA":\n wa[int(p) - 1] += 1\n else:\n ac[int(p) - 1] = 1\n\nif sum(ac) == 0:\n print(0,0)\nelse:\n print(sum(ac),sum(wa))\n', 'import numpy as np\n\nN,M = map(int,input().split())\n\nAC = np.array([0]*N)\nWA = np.array([0]*N)\n\nfor i in range(M):\n p,S = input().split()\n\n if AC[int(p)-1] ==0 and S == "WA":\n WA[int(p)-1] += 1\n else:\n AC[int(p)-1] = 1\n\nprint(sum(AC),sum(AC*WA))\n']
['Runtime Error', 'Accepted']
['s094469364', 's372145927']
[14768.0, 16720.0]
[168.0, 862.0]
[311, 267]
p02802
u972658925
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m = map(int,input().split())\nac = [0]*n\nwa = [0]*n\npena = 0\n\nfor i in range(m):\n p,s = map(str,input().split())\n p = int(p)-1 \n if s == "WA" and ac[p] == 0:\n wa[p] += 1\n elif s == "AC" and ac[p] == 0:\n ac[p] = 1\n pena += wa[p] \n elif ac[p] == 1:\n continue\n\nprint(str(sum(ac)) + " " + str(pena)', 'n,m = map(int,input().split())\nac = [0]*n\nwa = [0]*n\npena = 0\n\nfor i in range(m):\n p,s = map(str,input().split())\n p = int(p)-1 \n if s == "WA" and ac[p] == 0:\n wa[p] += 1\n elif s == "AC" and ac[p] == 0:\n ac[p] = 1\n pena += wa[p] \n elif ac[p] == 1:\n continue\n\nprint(str(sum(ac)) + " " + str(pena))']
['Runtime Error', 'Accepted']
['s807289811', 's377780285']
[3064.0, 4596.0]
[17.0, 354.0]
[452, 453]
p02802
u977141657
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['flag_p = p[0]\nflag_ac = 0\nAC_sum = 0\nWA_sum = 0\nWA = 0\n\nfor i in range(M):\n\n if flag_p == p[i]:\n if S[i] == 0 and flag_ac == 0:\n WA += 1\n print("1!")\n elif S[i] == 1 and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n WA = 0\n flag_ac = 1\n print("2!")\n print(flag_p)\n \n else:\n flag_p = p[i]\n flag_ac = 0\n WA_sum += WA\n WA = 0\n if S[i] == 0 and flag_ac == 0:\n WA += 1\n print("3!")\n elif S[i] == 1 and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n flag_ac = 1\n print("4!")\n print(flag_p)\n\nprint(AC_sum, WA_sum)', "import sys\n\nN, M = map(int, input().split())\nif M == 0:\n print(0, 0)\n sys.exit()\n\np_S = []\nfor _ in range(M):\n p_S.append(input().split())\n \np = []\nS = []\n\nfor i in range(M):\n p.append(p_S[i][0])\n S.append(p_S[i][1]=='AC')\n\np = list(map(int, p))\nS = list(map(int, S))\n\nflag_p = p[0]\nflag_ac = 0\nAC_sum = 0\nWA_sum = 0\nWA = 0\n\nfor i in range(M):\n\n if flag_p == p[i]:\n if S[i] == 0 and flag_ac == 0:\n WA += 1\n elif S[i] == 1 and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n WA = 0\n flag_ac = 1\n else:\n flag_p = p[i]\n flag_ac = 0\n WA_sum = WA\n WA = 0\n if S[i] == 0 and flag_ac == 0:\n WA += 1\n elif S[i] == 1 and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n flag_ac = 1\n\nprint(AC_sum, WA_sum)", "N, M = map(int, input().split())\nfor _ in range(M):\n p, S = input().split()\np = map(int, p)\n\nflag_p = p[0]\nflag_ac = 0\nAC_sum = 0\nWA_sum = 0\n\nfor i in range(M):\n if flag_p == p[i]:\n if S[i] == 'WA':\n WA += 1\n elif S[i] == 'AC' and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n flag_ac = 1\n \n else:\n WA = 0\n flag = p[i]\n if S[i] == 'WA':\n WA += 1\n elif S[i] == 'AC' and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n flag_ac = 1\n \nprint(AC_sum. WA_sum)", 'N, M = map(int, input().split())\np_S = []\nfor _ in range(M):\n p_S.append(input().split())\n \np = []\nS = []\n\nflag_p = p[0]\nflag_ac = 0\nAC_sum = 0\nWA_sum = 0\nWA = 0\n\nfor i in range(M):\n\n if flag_p == p[i]:\n if S[i] == 0 and flag_ac == 0:\n WA += 1\n elif S[i] == 1 and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n WA = 0\n flag_ac = 1\n \n else:\n flag_p = p[i]\n flag_ac = 0\n WA_sum += WA\n WA = 0\n if S[i] == 0 and flag_ac == 0:\n WA += 1\n elif S[i] == 1 and flag_ac == 0:\n AC_sum += 1\n WA_sum += WA\n flag_ac = 1\n\nprint(AC_sum, WA_sum)', 'n,m=map(int,input().split())\nac=[0]*n\nwa=[0]*n\nfor i in range(m):\n p,s=input().split()\n p=int(p)\n if ac[p-1] == 1:\n continue\n \n if s==\'AC\':\n ac[p-1] = 1\n else:\n wa[p-1] += 1\n \n\nAC=0\nWA=0\nfor i in range(n):\n AC += ac[i]\n if ac[i] == 1:\n WA += wa[i]\nprint("{} {}".format(AC,WA))']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s102639371', 's347538506', 's493068911', 's996857489', 's376310539']
[3064.0, 37812.0, 3064.0, 32148.0, 4596.0]
[18.0, 326.0, 169.0, 211.0, 295.0]
[727, 860, 513, 700, 601]
p02802
u977642052
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['def main(n, m, p_s):\n st = [False for _ in range(n)]\n ac, wa = 0, 0\n\n for p, s in p_s:\n if st[p - 1]:\n continue\n\n if s == "AC":\n ac += 1\n st[p - 1] = True\n if s == "WA":\n wa += 1\n\n print(ac, wa)\n\n\nif __name__ == "__main__":\n n, m = map(int, input().split())\n p_s = [list(map(int, input().split())) for _ in range(m)]\n\n main(n, m, p_s)\n', 'def main(n, m, p_s: list):\n data = {"WA": set(), "AC": set()}\n for p, s in p_s:\n data[s].add(int(p))\n\n print(len(data["AC"]), len(data["WA"]))\n\n\nif __name__ == "__main__":\n n, m = map(int, input().split())\n p_s = [input().split() for _ in range(m)]\n', 'def main(n: int, m: int, p_s: list):\n bool_ac = [False for _ in range(n)]\n count_wa = [0 for _ in range(n)]\n ac, wa = 0, 0\n\n for p, s in p_s:\n p = int(p)\n\n if bool_ac[p - 1]:\n continue\n\n if s == "AC":\n bool_ac[p - 1] = True\n wa += count_wa[p - 1]\n ac += 1\n elif s == "WA":\n count_wa[p - 1] += 1\n\n print(ac, wa)\n\n\nif __name__ == "__main__":\n n, m = map(int, input().split())\n p_s = [input().split() for _ in range(m)]\n\n main(n, m, p_s)\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s345841239', 's912611837', 's883213832']
[3060.0, 32144.0, 33888.0]
[19.0, 223.0, 275.0]
[421, 271, 542]
p02802
u978178314
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N, M = map(int, input().split())\nisAC = [False] * (N+1)\npenalties = [0] * (N+1)\nac, penalty = (0, 0)\nfor _ in range(M):\n p, s = input().split()\n p = int(p)\n if s == "AC":\n if not isAC[p]:\n isAC[p] = True\n ac += 1\n p += penalties[p]\n else:\n penalties[p] += 1\nprint(ac, penalty)', 'N, M = map(int, input().split())\nisAC = [False] * (N+1)\npenalties = [0] * (N+1)\nac, penalty = (0, 0)\nfor _ in range(M):\n p, s = input().split()\n p = int(p)\n if s == "AC":\n if not isAC[p]:\n isAC[p] = True\n ac += 1\n p += penalties[p]\n else:\n penalties[p] += 1\nprint(ac, penalty)', 'N, M = map(int, input().split())\nisAC = [False] * (N+1)\npenalties = [0] * (N+1)\nac, penalty = (0, 0)\nfor _ in range(M):\n p, s = input().split()\n p = int(p)\n if s == "AC":\n if not isAC[p]:\n isAC[p] = True\n ac += 1\n penalty += penalties[p]\n else:\n penalties[p] += 1\nprint(ac, penalty)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s274466673', 's313831761', 's583852519']
[4596.0, 4596.0, 4596.0]
[277.0, 267.0, 268.0]
[301, 301, 307]
p02802
u985374340
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N, M = list(map(int, input().split()))\n\np = [0] * M\nS = [\'\'] * M\n\n\nfor i in range(M):\n p[i], S[i] = input().split()\n p[i] = int(p[i])\n\ndp = [[0] * 2 for i in range(N)] \n\nfor i in range(M):\n num = p[i] - 1\n \n if(dp[num][0] == 0):\n if(S[i] == \'WA\'):\n dp[num][1] += 1\n continue\n\n elif(S[i] == \'AC\'):\n dp[num][0] += 1\n continue\n else:\n print("S is ??")\n\nscore = 0\npenalty = 0\nfor i in range(len(dp)):\n score += dp[i][0]\n penalty += dp[i][1]\n\nprint(score, penalty)\n~', "N, M = list(map(int, input().split()))\n\np = [0] * M\nS = [''] * M\n\n\nfor i in range(M):\n p[i], S[i] = input().split()\n p[i] = int(p[i])\n\npenalty = 0\nright_ans = 0\n\ndp = [[0] * 2 for i in range(N)] \n\nfor i in range(M):\n\n \n if(dp[p[i]][0] > 0):\n continue\n\n if(S[i] == 'AC'):\n dp[p[i]][0] += 1\n continue\n\n elif(S[i] == 'WA'):\n dp[p[i]][1] += 1\n\nprint(right_ans, penalty)", "N, M = list(map(int, input().split()))\n\np = [0] * M\nS = [''] * M\n\n\nfor i in range(M):\n p[i], S[i] = input().split()\n p[i] = int(p[i])\n\nWAnum = 0\nACnum = 0\n\nWA = [0] * N\nAC = [0] * N\n\nfor i in range(M):\n num = p[i] - 1\n \n if(AC[num] >= 1):\n continue\n\n if(S[i] == 'WA'):\n WA[num] += 1\n\n elif(S[i] == 'AC'):\n AC[num] = 1\n ACnum += 1\n WAnum += WA[num]\n\nprint(ACnum, WAnum)"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s148450771', 's817770471', 's267921761']
[3064.0, 23540.0, 14836.0]
[17.0, 333.0, 295.0]
[761, 452, 456]
p02802
u987164499
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['from sys import stdin\nn,m = [int(x) for x in stdin.readline().rstrip().split()]\n\nif m == 0:\n print(0,0)\n exit()\n\nli = [list(stdin.readline().rstrip().split()) for _ in range(m)]\nli.sort()\n\ncor = 0\nwor = 0\nnow = int(li[0][0])\nfor i in li:\n if int(i[0]) == now:\n if i[1] == "WA":\n wor += 1\n else:\n cor += 1\n now += 1\nprint(cor,wor)\n\n', 'from sys import stdin\nn,m = [int(x) for x in stdin.readline().rstrip().split()]\n\nli = [list(stdin.readline().rstrip().split()) for _ in range(m)]\nlin = [0]*(n+1)\nwor = [0]*(n+1)\n\nfor i in li:\n if lin[int(i[0])] == 0:\n if i[1] == "WA":\n wor[int(i[0])] += 1\n elif i[1] == "AC":\n lin[int(i[0])] = 1\nwa = 0\nfor i in range(n+1):\n if lin[i] == 1:\n wa += wor[i]\n\nprint(sum(lin),wa)\n']
['Wrong Answer', 'Accepted']
['s956181062', 's453276360']
[26372.0, 27476.0]
[339.0, 217.0]
[387, 424]
p02802
u993310962
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["n,m=map(int, input().split())\nac,wa=0,0\nif m==0:\n print(ac,wa)\nelse: \n l=[0]*n \n r=[0]*n \n for i in range(m):\n pa,s=map(str, input().split())\n p=int(pa)\n if l[p-1]==0 and s=='AC': \n l[p-1]=1\n ac+=1\n elif s=='WA': \n r[p-1]+=1\n else:\n continue\n for i in range(n):\n if l[i]==1:\n wa+=w[i]\n else:\n continue\n print(ac,wa)", "n,m=map(int, input().split())\nac,wa=0,0\nif m==0:\n print(ac,wa)\nelse: \n l=[0]*n \n r=[0]*n \n for i in range(m):\n pa,s=map(str, input().split())\n p=int(pa)\n if l[p-1]==0 and s=='AC': \n l[p-1]=1\n ac+=1\n elif l[p-1]==0 and s=='WA': \n r[p-1]+=1\n else:\n continue\n for i in range(n):\n if l[i]==1:\n wa+=r[i]\n else:\n continue\n print(ac,wa)"]
['Runtime Error', 'Accepted']
['s809829850', 's271405927']
[4596.0, 4596.0]
[337.0, 356.0]
[627, 641]
p02802
u993435350
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['N,M = map(int,input().split())\nPS = []\n\nT = [0] * (N + 1)\nans = [0,0]\n\n\nfor i in range(M):\n p,s = input().split()\n p = int(p)\n if T[p] == 0:\n T[p] = s\n if s == "AC":\n ans[0] += 1\n T[p] = "AC"\n elif s == "WA":\n ans[1] += 1\n T[p] = "WA"\n \n elif T[p] == "AC":\n continue\n\n elif T[p] == "WA":\n if s == "AC":\n T[p] == s\n ans[0] += 1\n elif s == "WA":\n ans[1] += 1\n continue\n \nprint(ans[0],ans[1])\n\n', 'N,M = map(int,input().split())\nPS = []\n\nT = [0] * (N + 1)\nans = [0,0]\n\n\nfor i in range(M):\n p,s = input().split()\n p = int(p)\n if T[p] == 0:\n T[p] = s\n if s == "AC":\n ans[0] += 1\n elif s == "WA":\n ans[1] += 1\n \n elif T[p] == "AC":\n continue\n elif T[p] == "WA":\n if s == "AC":\n T[p] == s\n ans[0] += 1\n elif s == "WA":\n ans[1] += 1\n \nprint(ans[0],ans[1])\n\n', 'N,M = map(int,input().split())\nPS = []\n\nT = [0] * (N + 1)\nA = 0\nW = [0] * (N + 1)\n\nans = [0,0]\n\nfor i in range(M):\n p,s = input().split()\n p = int(p)\n PS.append([p,s])\n\nfor i in range(M):\n p = PS[i][0]\n s = PS[i][1]\n\n if T[p] == 0:\n if s == "AC":\n A += 1\n T[p] = "AC"\n elif s == "WA":\n W[p] += 1\n T[p] = "WA"\n \n elif T[p] == "AC":\n continue\n\n elif T[p] == "WA":\n if s == "AC":\n T[p] = "AC"\n A += 1\n elif s == "WA":\n W[p] += 1\n\nw = 0\n\nfor i in range(1,N + 1):\n if T[i] == "AC":\n w += W[i]\n \nprint(A,w)\n\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s427034035', 's542257009', 's051055475']
[3828.0, 9332.0, 23460.0]
[299.0, 292.0, 350.0]
[464, 412, 574]
p02802
u994034374
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
["#C - Welcome to AtCoder\nN,M = list(map(int, input().split()))\np = []\nS = []\nfor k in range(M):\n p_input,S_input = input().split()\n p.append(p_input)\n S.append(S_input)\np = list(map(int, p))\n\nj = 0\nsum_ac,sum_wa = 0,0\nfor i in range(N):\n try:\n flg = 0\n while p[j] == i + 1:\n if S[j] == 'WA':\n print('WA')\n j = j + 1\n sum_wa = sum_wa + 1\n elif S[j] == 'AC' and flg == 0:\n print('AC')\n flg = flg + 1\n j = j + 1\n sum_ac = sum_ac + 1\n else:\n j = j + 1\n except IndexError:\n pass\n\nprint(sum_ac,sum_wa)", '#other\'s code\nN,M=map(int,input().split())\n \nac = 0\nwa = 0\naclist = {}\nwalist = {}\n\nfor i in range(N):\n aclist[i + 1] = 0\n walist[i + 1] = 0\n\nfor i in range(M):\n a,b=input().split()\n a=int(a)\n if aclist[a] == 1:\n continue\n elif b == \'WA\':\n walist[a] += 1\n elif b == \'AC\':\n aclist[a] += 1\n ac += 1\n wa += walist[a]\n\nprint(ac,wa,sep=" ")']
['Wrong Answer', 'Accepted']
['s948003100', 's902833580']
[19656.0, 24212.0]
[288.0, 339.0]
[683, 391]
p02802
u995419623
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['n,m=map(int,input().split())\nps=[list(input().split()) for i in range(m)]\npen=[0]\nrig=[0]\n\nfor i in range(m):\n if ps[i][1] == "AC":\n rig[int(ps[i][0])-1]=1\n else:\n if rig[int(ps[i][0]-1)] == 0:\n pen[int(ps[i][0]-1)]+=1\n\ncnt1,cnt2=0,0\nfor i in range(n):\n if rig[i]==1:\n cnt1+=rig[i]\n cnt2+=pen[i]\n \nprint(str(cnt1)+" "+str(cnt2))', 'n,m=map(int,input().split())\nps=[list(input().split()) for i in range(m)]\npen=[0]*n\nrig=[0]*n\n\nfor i in range(m):\n if ps[i][1] == "AC":\n rig[int(ps[i][0])-1]=1\n else:\n if rig[int(ps[i][0]-1)] == 0:\n pen[int(ps[i][0]-1)]+=1\n\ncnt1,cnt2=0,0\nfor i in range(n):\n if rig[i]==1:\n cnt1+=rig[i]\n cnt2+=pen[i]\n \nprint(str(cnt1)+" "+str(cnt2))\n', 'n,m=map(int,input().split())\nps=[list(input().split()) for i in range(m)]\npen=[0]*n\nrig=[0]*n\n\nfor i in range(m):\n if ps[i][1] == "AC":\n rig[int(ps[i][0])-1]=1\n else:\n if rig[int(ps[i][0])-1] == 0:\n pen[int(ps[i][0])-1]+=1\n\ncnt1,cnt2=0,0\nfor i in range(n):\n if rig[i]==1:\n cnt1+=rig[i]\n cnt2+=pen[i]\n \nprint(str(cnt1)+" "+str(cnt2))']
['Runtime Error', 'Runtime Error', 'Accepted']
['s888247947', 's912604443', 's376000115']
[25912.0, 27456.0, 27456.0]
[223.0, 305.0, 318.0]
[351, 356, 355]
p02802
u996434204
2,000
1,048,576
Takahashi participated in a contest on AtCoder. The contest had N problems. Takahashi made M submissions during the contest. The i-th submission was made for the p_i-th problem and received the verdict S_i (`AC` or `WA`). The number of Takahashi's correct answers is the number of problems on which he received an `AC` once or more. The number of Takahashi's penalties is the sum of the following count for the problems on which he received an `AC` once or more: the number of `WA`s received before receiving an `AC` for the first time on that problem. Find the numbers of Takahashi's correct answers and penalties.
['import sys\n\nn,m=map(int,input().split())\n\nif m==0:\n print(0,0)\n sys.exit()\n\np=[]\ns=[]\nfor i in range(m):\n pp,ss=input().split()\n p.append(int(pp))\n s.append(ss)\n\np.append(max(p)+1)\n\nsei=0\npena=0\n\nprint(len(p))\n\ni=0\n\nwhile(True):\n #print(i)\n #print("p[i],p[-1]:",p[i],p[-1])\n if p[i]==p[-1]: break\n if s[i]==\'WA\':\n pena+=1\n else:\n sei+=1\n #print("p[i]+1:",p[i]+1)\n i=p.index(p[i]+1)-1\n #print("i:",i)\n i+=1\n \nprint(sei,pena)\n', "n,m=map(int,input().split())\nac = [0] * n\nwa = [0] * n\n\nfor i in range(m):\n p,s = map(str,input().split())\n p = int(p)\n if ac[p-1] != 1:\n if s == 'WA':\n wa[p-1] += 1\n elif s == 'AC':\n ac[p-1] += 1\n\nfor i in range(n):\n if ac[i] == 1:\n continue\n elif ac[i] == 0:\n wa[i] = 0\n \nprint(sum(ac),sum(wa))\n"]
['Runtime Error', 'Accepted']
['s061553968', 's404820032']
[13388.0, 4596.0]
[2104.0, 358.0]
[503, 369]
p02811
u003475507
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["a = int(input())\nb = input()\n\nprint(b.count('ABC'))", "k,x = map(int,input().split())\n\nif 500*k >= x:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s325809311', 's249013796']
[2940.0, 2940.0]
[18.0, 17.0]
[51, 85]
p02811
u006883624
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k, x = [int(v) for v in input().split()]\n\nif 500 * k >= x:\n print("YES");\nelse:\n print("NO");', '#from math import sqrt\n#from heapq import heappush, heappop\n#from collections import deque\n#s, t = [int(v) for v in int(input())]\n\n\ndef main():\n k, x = map(int, input().split())\n\n if k * 500 >= x:\n print("Yes")\n else:\n print("No")\n\n\nmain()\n']
['Wrong Answer', 'Accepted']
['s905322518', 's272523263']
[2940.0, 2940.0]
[17.0, 17.0]
[95, 263]
p02811
u009885900
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["K,X = map(int, input().split())\nif K*500 > X:\n\tprint('YES')\nelse:\n\tprint('NO')", "K,X = map(int, input().split())\nif K*500 >= X:\n\tprint('Yes')\nelse:\n\tprint('No')"]
['Wrong Answer', 'Accepted']
['s848083669', 's304858124']
[2940.0, 2940.0]
[17.0, 18.0]
[78, 79]
p02811
u010462426
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['def lcm (a,b):\n\tif a<b:\n\t\tt=a\n\t\ta=b\n\t\tb=t\n\tx=a*b\n\tr=a%b\n\twhile r!=0:\n\t\ta=b\n\t\tb=r\n\t\tr=a%b\n\treturn x/b\n\n[n, m]=[int(x) for x in input().split()]\na=[int(x) for x in input().split()]\ni=0\na_lcm=a[0]\nfor i in range(n-1):\n\ta_lcm = lcm(a_lcm,a[i+1])\n\nprint(int(((m*2/a_lcm)+1)/2))', '[s,t] = [int(x) for x in input().split()]\nif 500*s >= t:\n\tprint("Yes")\nelse:\n\tprint("No")']
['Runtime Error', 'Accepted']
['s637727083', 's152771975']
[3064.0, 2940.0]
[17.0, 17.0]
[272, 89]
p02811
u013956357
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['def gcd(m,n):\n x = max(m,n)\n y = min(m,n)\n\n if x%y == 0:\n return y\n else:\n while x%y!=0:\n z = x%y\n x = y\n y = z\n else:\n return z\n\ndef lcm(x, y):\n return (x * y) // gcd(x, y)\n\n[N,M] = [int(x) for x in input().split()]\na = [int(x) for x in input().split()]\n\nskoubaisu = 1\nfor x in a:\n skoubaisu = lcm(skoubaisu,x)\n\nif M*2 <= skoubaisu:\n print(0)\nelse:\n print(M//skoubaisu+1)', 'K,X = [int(x) for x in input().split()]\n\ntotal = K * 500\n\nif total >= X:\n print("Yes") \nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s391769819', 's658237239']
[3064.0, 2940.0]
[17.0, 18.0]
[457, 112]
p02811
u015593272
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['value = input().split(\' \')\nprint(value)\n\nK = int(value[0])\nThreshold = int(value[1])\n\nif (K*500 >= Threshold):\n print("Yes")\nelse:\n print("No")', "K,X=map(int,input().split())\nsumm=500*K\nif(summ>=X):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s338018174', 's862024203']
[2940.0, 2940.0]
[18.0, 17.0]
[149, 87]
p02811
u016901717
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k,x =map(int,input())\nif x<=500*k:\n print("Yes")\nelse:\n print("No")', 'k,x=map(int,input().split())\nif 500*k>=x:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s717625659', 's940228193']
[3060.0, 2940.0]
[18.0, 17.0]
[69, 80]
p02811
u017624958
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["K = int(input())\nX = int(input())\n\ntotal = 500 * K;\nanswer = 'Yes' if total >= X else 'No';\n\nprint(answer);\n", "inputted = list(map(int, input().split()))\nK = int(input())\nX = int(input())\n\ntotal = 500 * K;\nanswer = 'Yes' if total >= X else 'No';\n\nprint(answer);\n", "inputted = list(map(int, input().split()))\nK = inputted[0]\nX = inputted[1]\n\ntotal = 500 * K;\nanswer = 'Yes' if total >= X else 'No';\n\nprint(answer);\n"]
['Runtime Error', 'Runtime Error', 'Accepted']
['s092096548', 's638860950', 's064027191']
[2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0]
[108, 151, 149]
p02811
u019355060
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K,X = map(int, input().split())\nv = 500 * K\nif s >= X:\n print("Yes")\nelse:\n print("No")\n', 'K,X = map(int, input().split())\nv = 500 * K\nif v >= X:\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Accepted']
['s318950997', 's958467225']
[2940.0, 3060.0]
[17.0, 19.0]
[94, 94]
p02811
u021657949
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k,x=map(int,input(),split())\nprint("Yes" if 500*k>=x else "No")', 'k,x=map(int,input().split())\nprint("Yes" if 500*k>=x else "No")']
['Runtime Error', 'Accepted']
['s401527074', 's762471916']
[9072.0, 8808.0]
[26.0, 28.0]
[63, 63]
p02811
u024496314
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k, n = [int(x) for x input().split()]\n\nif k*500 >= n:\n print("YES")\nelse:\n print("NO")', 'k, n = [int(x) for x in input().split()]\n\nif k*500 >= n:\n print("YES")\nelse:\n print("NO")\n', 'k, n = [int(x) for x in input().split()]\n\nif k*500 >= n:\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s129899961', 's617324685', 's872277604']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[88, 92, 92]
p02811
u027403702
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K,X = map(int, input().split())\n# N = int(input())\n\n# C = int(input())\n# s= input()\nprint("Yes" if K * 2 >= X else "No")', 'K,X = map(int, input().split())\n# N = int(input())\n\n# C = int(input())\n# s= input()\nprint("Yes" if K * 500 >= X else "No")']
['Wrong Answer', 'Accepted']
['s236638546', 's422966826']
[2940.0, 2940.0]
[17.0, 18.0]
[138, 140]
p02811
u040340090
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K = int(input())\nprint(K)\nX = int(input())\nprint(X)\n\nif 500*K >= X:\n\tprint("Yes")\nelse:\n\tprint("No")', 'if 500*K >= X:\n\tprint("Yes")\nelse:\n\tprint("No")', 'K, X = map(int, input().split())\n\nif 500*K >= X:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s387658992', 's972327747', 's622286484']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[100, 47, 87]
p02811
u053909865
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["K, X = map(int, input().split())\n\nif 500*K >= X:\n print('YES')\nelse:\n print('NO')", "K, X = map(int, input().split())\n\nif 500*K >= X:\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s229234770', 's724902612']
[2940.0, 2940.0]
[19.0, 19.0]
[87, 87]
p02811
u054473438
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K, X = input().split()\nif K * 500 > X:\n print("Yes")\nelse:\n print("No")', 'K, X = input().split()\nK, X = int(K), int(X)\nif K * 500 >= X:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s539912256', 's404509042']
[2940.0, 2940.0]
[17.0, 17.0]
[73, 96]
p02811
u054825571
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['N,X=map(int, input(),split())\nprint("Yes" if 500*N >= X else "No")', 'N,X=map(int, input().split())\nprint("Yes" if 500*N >= X else "No")']
['Runtime Error', 'Accepted']
['s452754680', 's194483126']
[8992.0, 8956.0]
[26.0, 29.0]
[66, 66]
p02811
u054858774
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["k, x = map(int, input().sprit())\nif k*500>=x:\n print('Yes')\nelse:\n print('No')", "k, x = map(int, input().split())\nif k*500>=x:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s056864938', 's441181696']
[2940.0, 3060.0]
[17.0, 19.0]
[80, 80]
p02811
u055854974
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K, X = list(map(int, input().split()))\nprint("yes" if 500 * K >= X else "no" )', 'K, X = list(map(int, input().split()))\nprint("Yes" if 500 * K >= X else "No" )']
['Wrong Answer', 'Accepted']
['s359832528', 's176830744']
[2940.0, 2940.0]
[17.0, 17.0]
[78, 78]
p02811
u056659569
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K,X=map(int, input().split())\nif 500*K>X\n\tprint("yes")\nelse print("no")', 'K, X = map(int, input().split())\nif (500*K>=X):\n print("Yes")\nelse:\n print("No")\n']
['Runtime Error', 'Accepted']
['s405040597', 's115563540']
[2940.0, 2940.0]
[17.0, 17.0]
[71, 83]
p02811
u061406236
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["k,x=map(int, input()split())\n\nif 500*k >= x:\n print('Yes')\nelse:\n print('No')", "k,x=map(int, input().split())\n\nif 500*k >= x:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s190032641', 's405005984']
[2940.0, 2940.0]
[17.0, 17.0]
[83, 84]
p02811
u062736195
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K = int(input())\nX = int(input())\n\nif K*500 >= X:\n print("Yes")\n\n', 'K = input()\nX = input()\n\nif K*500 >= X:\n print("Yes")\nelse:\n print("No")', 'K = int(input())\nX = int(input())\n\nif K*500 >= X:\n print("Yes")\nelse:\n print("No")\n', 'K,X = map(int, input().split())\n\nif K*500 >= X:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s114213631', 's149392503', 's460727247', 's382590864']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 20.0, 17.0]
[66, 74, 85, 82]
p02811
u064264248
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['N = input()\ns = list(str(input()))\n\ncount = 0\n\nfor i in range(len(s)-2):\n if(s[i]+s[i+1]+s[i+2]=="ABC"):\n count += 1\n\nprint(count)', 'S = input().split()\nK = int(S[0])\nX = int(S[1])\n\nif(500*K >= X):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s128327348', 's604775099']
[2940.0, 2940.0]
[17.0, 17.0]
[140, 103]
p02811
u068142202
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['import itertools\n\nn = int(input())\np = list(map(int, input().split()))\nq = list(map(int, input().split()))\n\nlist_range = list(range(1,n+1))\npattern_list = list(itertools.permutations(list_range, n))\npattern_list.sort()\nans = [0] * 2\nfor i in range(len(pattern_list)):\n if p == list(pattern_list[i]):\n ans[0] = i + 1\n elif q == list(pattern_list[i]):\n ans[1] = i + 1\nprint(abs(ans[0] - ans[1]))', 'k, x = map(int,input().split())\nif k * 500 >= x:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s068721749', 's752146158']
[3064.0, 2940.0]
[17.0, 17.0]
[401, 83]
p02811
u068862866
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K,X = map(int,input().split())\n\nif K*2>=X:\n print("Yes")\nelse:\n print("No")', 'K,X = map(int,input().split())\n \nif K*500>=X:\n print("Yes")\nelse:\n print("No")']
['Wrong Answer', 'Accepted']
['s772034859', 's007156218']
[9088.0, 9032.0]
[29.0, 29.0]
[77, 80]
p02811
u071916806
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["K,X=input().split()\nk=int(K)\nx=int(X)\nif 500*k>==x:\n print('Yes')\nelse:\n print('No')", "K,X=input().split()\nk=int(K)\nx=int(X)\nif 500*k>=x:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s085036279', 's935618552']
[2940.0, 2940.0]
[18.0, 18.0]
[86, 85]
p02811
u074140654
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['a,b = int(input()).strip().split()\np = 500 * a\nif p >= b:\n print("Yes")\nelse:\n print("No")', 'a,b = int(input().strip().split())\np = 500 * a\nif p >= b:\n print("Yes")\nelse:\n print("No")', 'a,b = input().strip().split()\na = int(a)\nb = int(b)\np = 500 * a\nif p >= b:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s598116028', 's746250156', 's099898498']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[92, 92, 109]
p02811
u078349616
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K, X = map(int, input().split())\nif 500*K >= X:\n print("Yes")\nelif:\n print("No")', 'K, X = map(int, input().split())\nif 500*K >= X:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s265963542', 's871405642']
[2940.0, 2940.0]
[17.0, 18.0]
[82, 82]
p02811
u079022116
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["a,b =int(input())\nif a * 500 >= b:\n print('Yes')\nelse:print('No')", "a,b =map(int,input().split())\nif a * 500 >= b:\n print('Yes')\nelse:print('No')"]
['Runtime Error', 'Accepted']
['s152530825', 's068562685']
[2940.0, 2940.0]
[18.0, 18.0]
[66, 78]
p02811
u084320347
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['N = int(input())\nP = list(map(int, input().split()))\nQ = list(map(int, input().split()))\n\nfac = [0] * 8\nfac[1] = 1\nfor i in range(2, N):\n fac[i] = i * fac[i - 1]\n\na = 0\nl = list(range(1, N + 1))\nfor i in range(N):\n a += l.index(P[i]) * fac[len(l) - 1]\n l.remove(P[i])\n\nb = 0\nl = list(range(1, N + 1))\nfor i in range(N):\n b += l.index(Q[i]) * fac[len(l) - 1]\n l.remove(Q[i])\n\nprint(abs(a - b))', "k,x = map(int,input().split())\nif(k*500 >=x)\n\tinput('Yes')\nelse:\n input('No')", "k,x = map(int,input().split())\nif k*500 >=x:\n\tinput('Yes')\nelse:\n input('No')", "k,x = map(int,input().split())\nif k*500 >=x:\n\tprint('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s534631725', 's822425550', 's946391116', 's776049222']
[3064.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0]
[407, 78, 78, 78]
p02811
u087912169
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K, X = map(int(input().split())\n\nif 500*K >= X:\n print("Yes")\nelse:\n print("No")', 'K, X = input(), input()\n\nif 500*K >= X:\n print("Yes")\nelse:\n print("No")', 'K, X = map(int, input().split())\n\nif 500*K >= X:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s078680661', 's925337130', 's865914974']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[82, 74, 83]
p02811
u089230684
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['processedIp = input.split(\' \')\nk = int(processedIp[0])\nx = int(processedIp[1])\ntotalValue = k*500\nif (totalValue >= x):\n print("Yes")\nelse:\n print("No")', 'processedIp = input.split(" ")\nk = int(processedIp[0])\nx = int(processedIp[1])\ntotalValue = k*500\nif (totalValue >= x):\n print("Yes")\nelse:\n print("No")', 'processedIp = input().split(" ")\nk = int(processedIp[0])\nx = int(processedIp[1])\ntotalValue = k*500\nif (totalValue >= x):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Runtime Error', 'Accepted']
['s123155669', 's279992076', 's355375517']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[158, 158, 160]
p02811
u089986702
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['a,b=map(int, input().split())\n\nif (1<=a and a<=100) and (1<= b and b<=100000) :\n\tif a*500 >= b:\n print("Yes")\n else:\n print("No")\nelse:\n\tprint("input value is too large")', 'a,b=map(int, input().split())\n \nif (1<=a and a<=100) and (1<= b and b<=100000) :\n if a*500 >= b:\n print("Yes")\n else:\n print("No")\nelse:\n\tprint("input value is too large")']
['Runtime Error', 'Accepted']
['s506626925', 's687548743']
[2940.0, 2940.0]
[17.0, 17.0]
[183, 191]
p02811
u094103573
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['a,b=map(int,input().split())\n\nif (500*a => b):\n print("Yes")\nelse:\n print("No")', 'a,b=map(int,input().split())\n \nif (500*a >= b):\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s695092099', 's513719475']
[2940.0, 2940.0]
[17.0, 18.0]
[81, 82]
p02811
u096022836
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["K, X = input().split()\nprint(K, X)\nif 500 * int(K) >= int(X):\n print('Yes')\nelse:\n print('No')", "K, X = input().split()\nif 500 * int(K) >= int(X):\n print('Yes')\nelse:\n print('No')"]
['Wrong Answer', 'Accepted']
['s446885622', 's685566741']
[2940.0, 2940.0]
[17.0, 17.0]
[100, 88]
p02811
u096294926
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['A = []\nx,y = map(int,input()A.split())\n\nif 500*x-y >= 0:\n print("Yes")\n \n else:\n print("No")', 'i = input()\nx,y = map(int,i.split())\n\nif 500*x-y>=0:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s568564456', 's092150553']
[2940.0, 2940.0]
[17.0, 18.0]
[98, 95]
p02811
u101442050
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k,x = input().split(" ")\nif (k*500>=x):\n print(\'Yes\')\nelse:\n print(\'No\')\n', 'k,x = input().split(" ")\nval = int(k)*500\nif (val>=int(x)):\n print(\'Yes\')\nelse:\n print(\'No\')\n']
['Wrong Answer', 'Accepted']
['s066499415', 's323817039']
[2940.0, 2940.0]
[18.0, 17.0]
[79, 99]
p02811
u106985169
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K X = map(int,input().split())\nif K*500 > X:\n print(Yes)\nelse:\n print(No)', 'K,X = map(int,input().split())\nif K*500 >= X:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s887514015', 's468783433']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 84]
p02811
u107091170
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['K,M=mao(int,input().split())\nif K*500>=M:\n print("Yes")\nelse:\n print("No")\n ', 'K,M=map(int,input().split())\nif K*500>=M:\n print("Yes")\nelse:\n print("No")\n \n']
['Runtime Error', 'Accepted']
['s472313600', 's472357261']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 80]
p02811
u112317104
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["def solve():\n N, M = map(int, input().split())\n return 'Yes' if None*500 >= M else 'No'\n\nprint(solve())", "def solve():\n N, M = map(int, input().split())\n return 'Yes' if N*500 >= M else 'No'\n\nprint(solve())"]
['Runtime Error', 'Accepted']
['s700618690', 's793910713']
[2940.0, 2940.0]
[18.0, 17.0]
[109, 106]
p02811
u112952458
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k,x = input().split(" ")\nk = int(k)\nx = int(x)\n\nprint(k,x)\n\ntext = "No"\n \nif k*500>=x:\n text = "Yes"\n \nprint(text)', 'k,x = input().split(" ")\n \ntext = "No"\n \nif k*500>=x:\n text = "Yes"\n \nprint(text)\n', 'k,x = input().split(" ")\nk = int(k)\nx = int(x)\n\nprint(k,x)\n\ntext = "No"\n \nif k*500>=x:\n text = "Yes"\n \nprint(text +"\\n")\n', 'k,x = input()\n\ntext = "No"\n\nif k*500>=x:\n text = "Yes"\n \nprint(text)', 'k,x = input().split(" ")\n\n\ntext = "No"\n \nif k*500>=x:\n text = "Yes"\n \nprint(text)\n\n', 'k,x = input().split(" ")\nk = int(k)\nx = int(x)\n\n\n\ntext = "No"\n \nif k*500>=x:\n text = "Yes"\n \nprint(text)\n\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s180068553', 's350122243', 's417697420', 's808351276', 's898447436', 's950045819']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[116, 84, 123, 70, 85, 108]
p02811
u116722061
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['n=input()\ns=input()\n\nprint(s.count("ABC"))', 'K,X=map(int,input().split())\nif 500*K>=X:\n\tprint("Yes")\n else:\n \tprint("No")\n', 'K,X=map(int,input().split())\nif 500*K>=X\n\tprint("Yes")\n else\n \tprint("No")', 'K,X=map(int,input().split())\nif 500*K>=X:\n\tprint("Yes")\nelse:\n \tprint("No")\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s022628104', 's646682570', 's973299263', 's517808504']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[42, 79, 76, 77]
p02811
u116767113
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["k ,x = map(int,input().split)\n\nif k*500 >= x:\n print('Yes')\nelse:\n print('No')", "k , x = map(int,input().split())\n\nif k*500 >= x:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s848903051', 's837758124']
[2940.0, 2940.0]
[17.0, 17.0]
[80, 83]
p02811
u121698457
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["print((lambda x:'Yes' if x[1]//500 >= x[0] else 'No')(list(map(int,input().split()))))", "print((lambda x:('Yes' if (x[1]//500 >= x[0]) else 'No'))(list(map(int,input().split()))))", "print((lambda x:('Yes' if (x[1] <= x[0]*500) else 'No'))(list(map(int,input().split()))))"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s281210106', 's970527300', 's057753173']
[2940.0, 2940.0, 2940.0]
[17.0, 16.0, 17.0]
[86, 90, 89]
p02811
u124498235
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['k, x = map(int, input().spilt())\nif 500*k >= x:\n\tprint("Yes")\nelse:\n\tprint ("No")', 'k, x = map(int, input().split())\nif 500*k >= x:\n\tprint("Yes")\nelse:\n\tprint ("No")']
['Runtime Error', 'Accepted']
['s329988298', 's656647256']
[2940.0, 2940.0]
[17.0, 18.0]
[81, 81]
p02811
u127025777
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
['a = list(map(int,input().split()))\nif 500 * a[0] >= a[1] :\n print(Yes)\nelse :\n print(No)', "a = list(map(int,input().split()))\nif 500*a[0] >= a[1] :\n print('Yes')\nelse :\n print('No')"]
['Runtime Error', 'Accepted']
['s816734133', 's348651798']
[3060.0, 2940.0]
[17.0, 17.0]
[90, 92]
p02811
u131267733
2,000
1,048,576
Takahashi has K 500-yen coins. (Yen is the currency of Japan.) If these coins add up to X yen or more, print `Yes`; otherwise, print `No`.
["k,x=map(int.input().split())\nif 500*k >= x:\n print('Yes')\nelse:\n print('No')", "k,x=list(map(int,(input().split())))\nif 500*k >= x:\n print('Yes')\nelse:\n print('No')"]
['Runtime Error', 'Accepted']
['s268807944', 's766013961']
[2940.0, 2940.0]
[17.0, 17.0]
[78, 86]