Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import copy
# input
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
  
# main / output
for i in range(n):
  tmp = copy.deepcopy(a)
  del tmp[i]
  print(max(tmp))

Fixed submission:
import copy
# input
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
  
# main / output
top = max(a)
if a.count(top) != 1:
  for i in range(n):
    print(top)
else:
  topind = a.index(top)

  tmp = copy.deepcopy(a)
  tmp[topind] = 0
  sub = max(tmp)
  
  for i in range(n):
    if i == topind:
      print(sub)
    else:
      print(top)
Buggy python submission (verdict: Time Limit Exceeded):
import math
# input
stairs, broken = map(int, input().split())
broken_list = []
for i in range(broken):
  broken_list.append(int(input()))
  
# main
goalable = True
for i in range(1, broken):
  if broken_list[i-1] == broken_list[i]-1:
    goalable = False
    break

if goalable:
  broken_list.append(stairs+1)
  now = 0
  ans_list = []
  for b in broken_list:
    cp = b - 1
    stg = cp - now
    tmp = 0
    
    if stg != 0:
      for x in range(stg+1):
        if (stg - x) % 2 == 0:
          y = (stg - x) // 2
          tmp += math.factorial(x+y) // (math.factorial(x) * math.factorial(y))
      ans_list.append(tmp)
    else:
      ans_list.append(1)
    now = b + 1
  
  ans = 1
  for i in ans_list:
    ans = (i * ans) % 1000000007
  print(ans)
else:
  print(0)



Fixed submission:
# input
stairs, broken = map(int, input().split())
conditions = [1] * (stairs + 1)
for i in range(broken):
  tmp = int(input())
  conditions[tmp] = 0
  
# main
for i in range(2, stairs+1):
  conditions[i] *= (conditions[i-1] + conditions[i-2]) % (10**9+7)

print(conditions[stairs])
Buggy python submission (verdict: Time Limit Exceeded):
# input
n, m = map(int, input().split())
nums = [int(i) for i in input().split()]
data = []
for i in range(m):
  data.append([int(i) for i in input().split()])

# main  
nums.sort()
for i in range(m):
  for j in range(data[i][0]):
    if nums[j] < data[i][1]:
      nums[j] = data[i][1]
    else:
      break
  nums.sort()

# output  
print(sum(nums))

Fixed submission:
# input
n, m = map(int, input().split())
data = [[int(i), 1] for i in input().split()]
for i in range(m):
  b, c = map(int, input().split())
  data.append([c, b])
data.sort(key=lambda x:x[0], reverse=True)

# main
ans = 0
cnt = n
for i in range(len(data)):
  if cnt >= data[i][1]:
    ans += data[i][0] * data[i][1]
    cnt -= data[i][1]
  else:
    ans += data[i][0] * cnt
    cnt -= data[i][1]
  if cnt <= 0:
    break
    
# output
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
print(s[:k-1] + s[k-1].lower + s[k:])

Fixed submission:
n, k = map(int, input().split())
s = list(input())

for i in range(n):
  if i == k-1:
    s[i] = s[i].lower()
    break
    
print("".join(s))
Buggy python submission (verdict: Runtime Error):
s = input()
acgt = ['A', 'C', 'G', 'T']
cnt = 0
ans = []

for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
  else:
    ans.append(cnt)
    cnt = 0

print(max(ans))

Fixed submission:
s = input()
acgt = ['A', 'C', 'G', 'T']
cnt = 0
ans = []

for i in range(len(s)):
  if s[i] in acgt:
    cnt += 1
  else:
    cnt = 0
  ans.append(cnt)

print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, K = map(int, input().split())
H = list(map(int, input().split()))
dp = [100000]*N
dp[0] = 0
for i in range(1, N):
    dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))
print(dp[N-1])


Fixed submission:
def test():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    dp = [float('inf')]*N
    dp[0] = 0

    for i in range(1, N):
        dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))

    print(dp[-1])

if __name__ == '__main__':
    test()

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
N, K = map(int, input().split())
H = list(map(int, input().split()))

dp = [float('inf')]*N
dp[0] = 0

for i in range(1, N):
    dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))

print(dp[N-1])


Fixed submission:
def test():
    N, K = map(int, input().split())
    H = list(map(int, input().split()))
    dp = [float('inf')]*N
    dp[0] = 0

    for i in range(1, N):
        dp[i] = min(dp[j] + abs(H[i] - H[j]) for j in range(max(i-K, 0), i))

    print(dp[-1])

if __name__ == '__main__':
    test()
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(a, b+1):
  if i < a + k or i > b - k:
    print(i)

Fixed submission:
a, b, k = map(int, input().split())
n = b - a + 1

if n > k * 2:
  for i in range(k):
    print(a+i)
  for i in range(k):
    print(b-(k-i-1))
else:
  for i in range(a, b+1):
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int, input().split())); a.sort()
b = list(map(int, input().split())); b.sort()
c = list(map(int, input().split())); c.sort()
ab = [0 for i in range(n)]
bc = [0 for i in range(n)]

for i in range(n):
  ab[i] = bisect.bisect_left(a, b[i])
for i in range(n):
  bc[i] = sum(ab[:bisect.bisect_left(b, c[i])])
  
print(sum(bc))

Fixed submission:
import bisect
n = int(input())
a = list(map(int, input().split())); a.sort()
b = list(map(int, input().split())); b.sort()
c = list(map(int, input().split())); c.sort()
ab = [0 for i in range(n)]
ans = 0

for i in range(n):
  ab[i] = ab[i-1] + bisect.bisect_left(a, b[i])
for i in range(n):
  tmp = bisect.bisect_left(b, c[i])
  if tmp != 0:
  	ans += ab[tmp-1] 

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a = list(map(int, input().split())); a.sort()
b = list(map(int, input().split())); b.sort()
c = list(map(int, input().split())); c.sort()
ab = [0 for i in range(n)]
bc = [0 for i in range(n)]

for i in range(n):
  ab[i] = bisect.bisect_left(a, b[i])
for i in range(n):
  bc[i] = sum(ab[:bisect.bisect_left(b, c[i])])
  
print(sum(bc))



Fixed submission:
import bisect
n = int(input())
a = list(map(int, input().split())); a.sort()
b = list(map(int, input().split())); b.sort()
c = list(map(int, input().split())); c.sort()
ab = [0 for i in range(n)]
ans = 0

for i in range(n):
  ab[i] = ab[i-1] + bisect.bisect_left(a, b[i])
for i in range(n):
  tmp = bisect.bisect_left(b, c[i])
  if tmp != 0:
  	ans += ab[tmp-1] 

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
K, S = map(int, input().split())
counter = 0

for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x + y + z == S:
                counter += 1   

print(counter)

Fixed submission:
# coding: utf-8
K, S = map(int, input().split())
ans = 0;

for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if z >= 0 and z <= K:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())
h = int(input())
return (a + b) * h / 2

Fixed submission:
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())
h = int(input())
print(int((a + b) * h / 2))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)

def card_trash(x):
  if x == "a":
    t = a.pop(0)
  elif x == "b":
    t = b.pop(0)
  elif x == "c":
    t = c.pop(0)
  return t
  
while True:
  trash = card_trash(trash)
  if a == []:
    print("A")
    break
  elif b == []:
    print("B")
    break
  elif c == []:
    print("C")
    break

Fixed submission:
# coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)

while True:
  if trash == "a":
    if len(a) == 0:
      print("A")
      break
    trash = a.pop(0)
  elif trash == "b":
    if len(b) == 0:
      print("B")
      break
    trash = b.pop(0)
  elif trash == "c":
    if len(c) == 0:
      print("C")
      break
    trash = c.pop(0)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)

def card_trash(x):
  if x == "a":
    t = a.pop(0)
  elif x == "b":
    t = b.pop(0)
  elif x == "c":
    t = c.pop(0)
  return t
  
while True:
  print("---")
  print(a)
  print(b)
  print(c)
  print("---")
  trash = card_trash(trash)
  if a == []:
    print("A")
    break
  elif b == []:
    print("B")
    break
  elif c == []:
    print("C")
    break

Fixed submission:
# coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)

while True:
  if trash == "a":
    if len(a) == 0:
      print("A")
      break
    trash = a.pop(0)
  elif trash == "b":
    if len(b) == 0:
      print("B")
      break
    trash = b.pop(0)
  elif trash == "c":
    if len(c) == 0:
      print("C")
      break
    trash = c.pop(0)

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
a = list(str(s) for s in input().split())
b = list(str(s) for s in input().split())
c = list(str(s) for s in input().split())
trash = "a"
end_flag = 0

def card_trash(x):
  if x == "a":
    t = a.pop(0)
  elif x == "b":
    t = b.pop(0)
  elif x = "c":
    t = c.pop(0)
  return t
  
while True:
  trash = card_trash(trash)
  if a == []:
    print("A")
    break
  elif b == []:
    print("B")
    break
  elif c == []:
    print("C")
    break

Fixed submission:
# coding: utf-8
a = list(input())
b = list(input())
c = list(input())
trash = a.pop(0)

while True:
  if trash == "a":
    if len(a) == 0:
      print("A")
      break
    trash = a.pop(0)
  elif trash == "b":
    if len(b) == 0:
      print("B")
      break
    trash = b.pop(0)
  elif trash == "c":
    if len(c) == 0:
      print("C")
      break
    trash = c.pop(0)
Buggy python submission (verdict: Runtime Error):
def solve():
    n,k = map(int, infile.readline().split())
    da = list(map(int,infile.readline().split()))
    infile.close()
    ans = 1
    MOD = 10**9+7
    
    if n == k:
        for i in range(n):
            ans = ans*da[i]%MOD
        return ans
    
    neg = []
    pos = []
    for i in range(n):
        if da[i] < 0:
            neg.append(da[i])
        else:
            pos.append(da[i])
    neg.sort()
    pos.sort()
    
    if len(pos) == 0 and k%2 == 1:
        neg.reverse()
        for i in range(k):
            ans = ans * da[i] % MOD
        return ans
    
    li = []
    pos.reverse()
    po, ne = 0, 0
    if k%2 == 1:
        po = 1
        ans = pos[0]
    while po+1 < len(pos):
        li.append(pos[po]*pos[po+1])
        po += 2
    while ne+1 < len(neg):
        li.append(neg[ne]*neg[ne+1])
        ne += 2
    li.sort()
    li.reverse()
    for i in range(k//2):
        ans = li[i] * ans % MOD
    return ans

if __name__ == "__main__":
    solve()


Fixed submission:
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

def solve():
    n, k = NextInts()
    da = NextIntList()
    ans = 1
    MOD = 10**9+7
    
    if n == k:
        for i in range(n):
            ans = ans*da[i]%MOD
        return ans
    
    neg = []
    pos = []
    for i in range(n):
        if da[i] < 0:
            neg.append(da[i])
        else:
            pos.append(da[i])
    neg.sort()
    pos.sort()

    if len(pos) == 0 and k%2 == 1:
        neg.reverse()
        for i in range(k):
            ans = ans * neg[i] % MOD
        return ans
    
    pos.reverse()
    li = []
    po, ne = 0, 0
    if k%2 == 1:
        po = 1
        ans = pos[0]
    while po+1 < len(pos):
        li.append(pos[po]*pos[po+1])
        po += 2
    while ne+1 < len(neg):
        li.append(neg[ne]*neg[ne+1])
        ne += 2
    li.sort()
    li.reverse()
    for i in range(k//2):
        ans = li[i] * ans % MOD
    return ans

if __name__ == "__main__":
    print(solve())
Buggy python submission (verdict: Runtime Error):
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

a = int(input())
print((a**4-1)//(a-1)-1)

Fixed submission:
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

a = int(input())
print(a**3 + a**2 + a)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

n = int(input())
da = NextIntList()
da = sorted(da)
ans = 1
for i in range(n):
    ans *= da[i]
    if ans > 10**18:
        ans = -1

if ans < 0:
    print(-1)
else:
    print(ans)


Fixed submission:
from collections import deque
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

n = int(input())
da = NextIntList()
da = sorted(da)
ans = 1
for i in range(n):
    ans *= da[i]
    if ans > 10**18:
        ans = -1
    elif ans < 0:
        ans = -1

if ans < 0:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

used = {}
used[0] = 0
gg = {}

def dfs(n, a, b, c, d):
    global used
    # print(n)
    if n in used: return used[n]
    ret = n*d
    for i in range(-4, 4):
        now = n + i
        if now%2==0 and now > 0 and abs(i) < 2: ret = min(ret, abs(i)*d + a + dfs(now//2, a, b, c, d))
        if now%3==0 and now > 0 and abs(i) < 3: ret = min(ret, abs(i)*d + b + dfs(now//3, a, b, c, d))
        if now%5==0 and now > 0: ret = min(ret, abs(i)*d + c + dfs(now//5, a, b, c, d))
    return ret

def solve():
    n,a,b,c,d = NextInts()
    global used
    used = {}
    gg = {}
    used[0] = 0
    used[1] = d
    used[2] = min(d*2, d+a)
    return dfs(n, a, b, c,d)
    
def main():
    t = NextInt()
    ans = [solve() for i in range(t)]
    for i in range(t):
        print(ans[i])

if __name__ == "__main__":
    main()


Fixed submission:
def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

used = {}
used[0] = 0
gg = {}

def dfs(n, a, b, c, d):
    global used
    # print(n)
    if n in used: return used[n]
    ret = n*d
    for i in range(-4, 4):
        now = n + i
        if now%2==0 and now > 0 and abs(i) < 2: ret = min(ret, abs(i)*d + a + dfs(now//2, a, b, c, d))
        if now%3==0 and now > 0 and abs(i) < 3: ret = min(ret, abs(i)*d + b + dfs(now//3, a, b, c, d))
        if now%5==0 and now > 0: ret = min(ret, abs(i)*d + c + dfs(now//5, a, b, c, d))
    used[n] = ret
    return ret
        


def solve():
    n,a,b,c,d = NextInts()
    global used
    used = {}
    gg = {}
    used[0] = 0
    used[1] = d
    used[2] = min(d*2, d+a)
    return dfs(n, a, b, c,d)
    
def main():
    t = NextInt()
    ans = [solve() for i in range(t)]
    for i in range(t):
        print(ans[i])

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

n,k = NextInts()
da = np.array(NextIntList(), np.int64)
for i in range(n):
    da[i]-=1

dp = np.zeros((61, n), dtype=np.int64)

dp[0] = da

for i in range(60):
    for j in range(n):
        dp[i+1][j] = dp[i][dp[i][j]]

ans = 0
for i in range(61):
    if k&1:
        ans = dp[i][ans]
    k >>= 1
print(ans+1)

Fixed submission:
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

n,k = NextInts()
da = NextIntList()
for i in range(n):
    da[i]-=1

dp = [[0 for i in range(n)] for i in range(61)]

dp[0] = da

for i in range(60):
    for j in range(n):
        dp[i+1][j] = dp[i][dp[i][j]]

ans = 0
for i in range(61):
    if k&1:
        ans = dp[i][ans]
    k >>= 1
print(ans+1)
Buggy python submission (verdict: Runtime Error):
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <limits.h>
#include <string>
#include <stack>
#include <deque>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <time.h>
#include <cassert>
#include <fstream>
#include <stdio.h>
#include<unordered_map>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define mapa make_pair
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
inline bool chmax(T &a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
template<typename T>
inline bool chmin(T &a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

template<typename T>
std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); }
template<typename T>
void vdeb(std::vector<T> &da) {
	for (int i = 0;i < da.size();i++) {
		if (i == da.size() - 1) std::cout << da[i];
		else std::cout << da[i] << ' ';
	}
	std::cout << std::endl;
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
	for (int i = 0;i < da.size();i++) vdeb(da[i]);
	std::cout << std::endl;
}

using namespace std;

int main(){
	int n,k,c; cin >> n >> k>> c;
	string s; cin >> s;
	if(c == 0){
		rip(i,n,0) if(s[i]=='o') k--;
		if(k < 0) return 0;
		rip(i,n,0){
			if(s[i] == 'o') printf("%d\n", i+1);
		}
		return 0;
	}
	vector<int> dp(n),dpp(n);
	dp[0] = 1;
	dpp[n-1] = 1;
	if(s[0] == 'x') dp[0] = 0;
	if(s[n-1] == 'x') dp[n-1] = 0;
	rip(i,n,1){
		dp[i] = dp[i-1];
		if(c < i && s[i] == 'o') chmax(dp[i], dp[i-c-1]+1);
		else chmax(dp[i], 1);
	}
	for(int i = n-2;i>-1;i--){
		dpp[i] = dpp[i+1];
		if(i+c+1 < n && s[i] == 'o') chmax(dpp[i], dpp[i+c+1]+1);
		else chmax(dpp[i], 1);
	}
	vector<int> ans(0);
	vector<int> su(n+1);
	rip(i,c+1,0){
		if(dpp[i] >= k) su[0]++, su[i]--;
	}
	rip(i,n-c-1,0){
		if(dp[i] + dpp[i+c+1] >=k) su[i+1]++, su[i+c+1]--;
	}
	rip(i,n,n-c-1){
		if(dp[i] >= k) su[n]--, su[i+1]++;
	}
	int ok= 0;
	rip(i,n,0){
		ok += su[i];
		if(ok == 0) ans.push_back(i+1);
	}
	// vdeb(dp);vdeb(dpp);vdeb(su);
	rip(i,ans.size(),0) printf("%d\n", ans[i]);
}

Fixed submission:
# n = int(input())
# s = input()
n,k = map(int,input().split())
# da = list(map(int,input().split()))
# a = [int(input()) for i in range(n)]
# da = [list(map(int,input().split())) for i in range(m)]

print(min(n%k, k-n%k))
Buggy python submission (verdict: Runtime Error):
n = int(input())
  print(n**3/27)


Fixed submission:
l = int(input())
#s = input()
#a,b = map(int,input().split())
#da = list(map(int,input().split()))
#a = [int(input()) for i in range(n)]

print((l/3)**3)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a > b: a,b = b,a
for i in ragne(b):
  print(a,end='')

Fixed submission:
a,b = map(int,input().split())
if a > b: a,b = b,a
for i in range(b):
  print(a,end='')
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
da = [map(str,input().split()) for i in range(m)]
penalty = [0 for i in range(n)]
accepted = [False for i in range(n)]
for i in range(m):
  now = int(da[i][0]) - 1
  if da[i][1] == 'AC':
    accepted[now] = True
  elif not accepted[now]:
    penalty[now] += 1
AC,WA = 0,0
for i in range(n):
  if accepted[i]:
    AC += 1
    WA += penalty[i]
print(AC,WA)
    


Fixed submission:
n,m = map(int,input().split())
da = [list(map(str,input().split())) for i in range(m)]
penalty = [0 for i in range(n)]
accepted = [False for i in range(n)]
for i in range(m):
  now = int(da[i][0]) - 1
  if da[i][1] == 'AC':
    accepted[now] = True
  elif not accepted[now]:
    penalty[now] += 1
AC,WA = 0,0
for i in range(n):
  if accepted[i]:
    AC += 1
    WA += penalty[i]
print(AC,WA)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
da = [map(str,input().split()) for i in range(m)]
penalty = [0 for i in range(n)]
accepted = [False for i in range(n)]
for i in range(m):
  now = int(da[i][0])
  if da[i][1] == 'AC':
    accepted[now] = True
  elif not accepted[now]:
    penalty[now] += 1
AC,WA = 0,0
for i in range(n):
  if accepted[i]:
    AC += 1
    WA += penalty[i]
print(AC,WA)
    

Fixed submission:
n,m = map(int,input().split())
da = [list(map(str,input().split())) for i in range(m)]
penalty = [0 for i in range(n)]
accepted = [False for i in range(n)]
for i in range(m):
  now = int(da[i][0]) - 1
  if da[i][1] == 'AC':
    accepted[now] = True
  elif not accepted[now]:
    penalty[now] += 1
AC,WA = 0,0
for i in range(n):
  if accepted[i]:
    AC += 1
    WA += penalty[i]
print(AC,WA)
Buggy python submission (verdict: Runtime Error):
prirt(int(input())^int(input()))


Fixed submission:
n = int(input())
m = int(input())
print((5 - n -m)%3 + 1)

Buggy python submission (verdict: Runtime Error):
prirt(int(input()^int(input()))

Fixed submission:
n = int(input())
m = int(input())
print((5 - n -m)%3 + 1)
Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
ans = 0
if a*a*b/2 >= x:
    x/=a
    x=x*2/b
    ans = math.atan(x/b)
else:
    x/=a*a
    x=(b-x)*2
    ans = math.atan(a/x)
print(90-ans/math.pi*180)

Fixed submission:
import math
a,b,x=map(int,input().split())
ans = 0
if a*a*b==x:
    ans = math.pi/2
elif a*a*b/2 >= x:
    x/=a
    x=x*2/b
    ans = math.atan(x/b)
else:
    x/=a*a
    x=(b-x)*2
    ans = math.atan(a/x)
print(90-ans/math.pi*180)