Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
dice = list(map(int, input().split()))
dice2 = list(map(int, input().split()))
mask = {
    'N': (1, 5, 2, 3, 0, 4),
    'R': (0, 2, 4, 1, 3, 5)
    }

a, b = dice2[0], dice2[1]

find = True
lim = 0

n_cmp_flg = False
while dice[0] != a:
    dice = [dice[x] for x in mask['N']]
    lim += 1
    if lim == 4:
        if n_cmp_flg:
            find = False
            break
        else:
            n_cmp_flg = True
            dice = [dice[x] for x in mask['R']]
            lim = 0
lim = 0
while dice[1] != b:
    dice = [dice[x] for x in mask['R']]
    lim += 1
    if lim == 4:
        find = False

if find:
    if dice == dice2:
        print("Yes")
    else:
        print("No")
else:
    print("No")



Fixed submission:
dice = list(map(int, input().split()))
dice2 = list(map(int, input().split()))
mask = {
    'N': (1, 5, 2, 3, 0, 4),
    'R': (0, 2, 4, 1, 3, 5)
    }

a, b = dice2[0], dice2[1]

find = False

for i in range(4):

    for j in range(4):
        if dice == dice2:
            find = True
            break
        dice = [dice[x] for x in mask['R']]

    if dice == dice2:
        find = True
        break
    dice = [dice[x] for x in mask['N']]

dice = [dice[x] for x in mask['R']]
dice = [dice[x] for x in mask['N']]
for j in range(4):
    if dice == dice2:
        find = True
        break
    dice = [dice[x] for x in mask['R']]

dice = [dice[x] for x in mask['N']]
dice = [dice[x] for x in mask['N']]
for j in range(4):
    if dice == dice2:
        find = True
        break
    dice = [dice[x] for x in mask['R']]

if find:

    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math

instr = input()
instrSp = instr.split()

a = int(instrSp[0])

print("{a:5f} {b:5f}".format(a=a * a * math.pi, b=2 * a * math.pi))



Fixed submission:
from math import pi

instr = input()
instrSp = instr.split()

a = float(instrSp[0])

print("{a:5f} {b:5f}".format(a=a * a * pi, b=2 * a * pi))

Buggy python submission (verdict: Runtime Error):
from math import pi

instr = input()
instrSp = instr.split()

a = int(instrSp[0])

print("{a:5f} {b:5f}".format(a=a * a * pi, b=2 * a * pi))



Fixed submission:
from math import pi

instr = input()
instrSp = instr.split()

a = float(instrSp[0])

print("{a:5f} {b:5f}".format(a=a * a * pi, b=2 * a * pi))
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, input().split())
z = math.sqrt((x1-x2)**2 + (y1-y2)**2)
print(z)


Fixed submission:
import math
x1, y1, x2, y2 = map(float, input().split())
z = math.sqrt((x1-x2)**2 + (y1-y2)**2)
print(z)
Buggy python submission (verdict: Runtime Error):
int = x
print(x**2)


Fixed submission:
x = int(input())
print(x ** 3)

Buggy python submission (verdict: Runtime Error):
int = x
y = x**3
print(y)


Fixed submission:
x = int(input())
print(x ** 3)
Buggy python submission (verdict: Runtime Error):
r = int(input())
p = 3.14159265 
print(p*r*r, p*r*2)


Fixed submission:
r = float(input())
p = 3.141592653589793
print(p*r*r, p*r*2)
Buggy python submission (verdict: Runtime Error):
count = int(input());
data = [];
for n in range(count):
    data.append(int(input()));

def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data);

def show(data):
    print(" ".join(str(n) for n in data));

insert_sort(data);


Fixed submission:
count = int(input());
data = [int(n) for n in input().split(" ")];

def insert_sort(data):
    show(data);
    for i in range(1, len(data)):
        n = data[i];
        j = i - 1;
        while j >= 0 and data[j] > n:
            data[j + 1] = data[j];
            j -= 1;
        data[j + 1] = n;
        show(data);

def show(data):
    print(" ".join(str(n) for n in data));

insert_sort(data);
Buggy python submission (verdict: Runtime Error):
data = [int(n) for n in input()];

def gcd(m, n):
    m = m % n;
    if m == 0:
        return n;
    return gcd(n, m);

print(gcd(max(data), min(data));


Fixed submission:
data = [int(n) for n in input().split(" ")];

def gcd(m, n):
    m = m % n;
    if m == 0:
        return n;
    return gcd(n, m);

print(gcd(max(data), min(data)));

Buggy python submission (verdict: Runtime Error):
data = [int(n) for n in input().split(" ")];

def gcd(m, n):
    m = m % n;
    if m == 0:
        return n;
    return gcd(n, m);

print(gcd(max(data), min(data));


Fixed submission:
data = [int(n) for n in input().split(" ")];

def gcd(m, n):
    m = m % n;
    if m == 0:
        return n;
    return gcd(n, m);

print(gcd(max(data), min(data)));
Buggy python submission (verdict: Runtime Error):
def cross_section_area(data):
    area = 0;
    k = 0;
    section_areas = [];
    section_area = 0;
    stack = [];
    for i in range(len(data)):
        if data[i] == '\\':
            stack.append(i);
        elif data[i] == '/':
            section_area += i - stack.pop();
            if len(stack) == 0:
                k += 1;
                section_areas.append(section_area);
                area += section_area;
    print(area);
    print(k, *section_areas);

cross_section_area(input());


Fixed submission:
def cross_section_area(data):
    area = 0;
    sections = [];
    stack = [];
    for i in range(len(data)):
        if data[i] == '\\':
            stack.append(i);
        elif data[i] == '/' and len(stack) > 0:
            j = stack.pop();
            section_area = i - j;
            area += section_area;
            while len(sections) > 0 and sections[-1][0] > j:
                section_area += sections[-1][1];
                sections.pop();
            sections.append([j, section_area]);
    print(area);
    print(len(sections), *[n[1] for n in sections]);

cross_section_area(input());
Buggy python submission (verdict: Runtime Error):
first_set_count = int(input());
first_set = [int(n) for n in input().split()];
second_set_count = int(input());
second_set = [int(n) for n in input().split()];

def binary_search(num, s, start, end):
    if start == end:
        if s[start] == num:
            return True;
        else:
            return False;
    else:
        mid = (start + end) // 2;
        if s[mid] == num:
            return True;
        elif num > s[mid]:
            start = mid + 1;
            return binary_search(num, s, start, end);
        else:
            end = mid - 1;
            return binary_search(num, s, start, end);

count = 0;
for num in second_set:
    if binary_search(num, first_set, 0, len(first_set) - 1):
        count += 1;
print(count);



Fixed submission:
first_set_count = int(input());
first_set = [int(n) for n in input().split()];
second_set_count = int(input());
second_set = [int(n) for n in input().split()];

def binary_search(num, s, start, end):
    while start < end:
        mid = (end + start) // 2;
        if num == s[mid]:
            return True;
        elif num > s[mid]:
            start = mid + 1;
        else:
            end = mid;
    return False;

count = 0;
for num in second_set:
    if binary_search(num, first_set, 0, len(first_set)):
        count += 1;
print(count);
Buggy python submission (verdict: Runtime Error):
def trace(A,input_num):
    if i != input_num - 1:   
        for i in range(input_num):
            print(A[i],end = " ")
    else:
        print(A[i])
        
    print("\n")

def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        trace(A,input_num)
        
        
input_num = int(input())
A = list(map(int, input().split()))

trace(A,input_num)



Fixed submission:
def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print(*A)
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num)

Buggy python submission (verdict: Runtime Error):
def trace(A,input_num):
    if i != input_num - 1:   
        for i in range(input_num):
            print(A[i],end = " ")
    else:
        print(A[i])
        
    print("\n")

def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        trace(A,input_num)
        
        
input_num = int(input())
A = list(map(int, input().split()))

trace(A,input_num)



Fixed submission:
def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print(*A)
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num)

Buggy python submission (verdict: Runtime Error):
def trace(A,input_num):
    if i != input_num - 1:   
        for i in range(input_num):
            print(A[i],end = " ")
    else:
        print(A[i])
        
    print("\n")

def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        trace(A,input_num)
        
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num)



Fixed submission:
def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print(*A)
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num)
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
def common_divisor(x,y):
    if x >= y:
        x = x % y
        for i in range(1,x):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor
    else:
        for i in range(1,x):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor

num1,num2 = raw_input().split()
maximam = common_divisor(int(num1), int(num2))
print(maximam)



Fixed submission:
# coding: UTF-8
def euclidean_algorithm(x,y):
    if x > y:
        p = y
        r = x%y
        while r != 0:
            a = p
            b = r
            p = b
            r = a%b
        return p
    elif x == y:
        return x
    elif x < y:
        p = x
        r = y%x
        while r != 0:
            a = p
            b = r
            p = b
            r = a%b
        return p

num1,num2 = raw_input().split()
maximam = euclidean_algorithm(int(num1), int(num2))
print(maximam)

Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
def common_div(x,y):
    divisor = 0
    x_mul = 0
    if x > y:
        x = x % y
        for i in range(1,x+1):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor
    elif x == y:
        divisor = x
        return divisor
    else:
        for i in [2,3,5,7]:
            if x % i == 0:
                x_mul = i
        if x_mul != 0:
            for j in  x_mul * range(1,x+1):
                if y % j == 0 and x % j == 0:
                    divisor = j
            if x <= j:
                break
            return divisor
        else:
            for k in range(1,x+1):
                if y % i == 0 and x % i == 0:
                    divisor = i
            return divisor


num1,num2 = raw_input().split()
maximam = common_div(int(num1), int(num2))
print(maximam)



Fixed submission:
# coding: UTF-8
def euclidean_algorithm(x,y):
    if x > y:
        p = y
        r = x%y
        while r != 0:
            a = p
            b = r
            p = b
            r = a%b
        return p
    elif x == y:
        return x
    elif x < y:
        p = x
        r = y%x
        while r != 0:
            a = p
            b = r
            p = b
            r = a%b
        return p

num1,num2 = raw_input().split()
maximam = euclidean_algorithm(int(num1), int(num2))
print(maximam)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: UTF-8
n = int(raw_input())
count = 0
for i in range(n):
    break_f = False
    j = 3
    num = int(raw_input())
    if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
    while j < num:
        if (num % j == 0):
            j += 2
            break_f = True
            break
        j += 2
    if break_f == True:
        continue
    count += 1
print(count)



Fixed submission:
# coding: UTF-8
n = int(raw_input())
count = 0
for i in range(n):
    num = int(raw_input())
    if (num < 2):
        continue
    elif (num == 2):
        count += 1
        continue
    elif (num % 2 == 0):
        continue
    if pow(2,num-1,num) == 1:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta

x = int(raw_input())
y = relativedelta(seconds=x)
x = "{0.hours:02}:{0.minutes:02}:{0.seconds:02}".format(relativedelta(seconds=x))
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta

x = int(raw_input())
y = relativedelta(seconds=x)
x = "{0.hours:02}:{0.minutes:02}:{0.seconds:02}".format(relativedelta(seconds=x))#02は二桁になる書式設定、最初の0は引数
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta

x = int(raw_input())
y = relativedelta(seconds=x)
x = "{0.hours:02}:{0.minutes:02}:{0.seconds:02}".format(relativedelta(seconds=x))#02は二桁になる書式設定、最初の0は引数
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta

x = int(raw_input())
y = relativedelta(seconds=x)
x = "{0.hours:02}:{0.minutes:02}:{0.seconds:02}".format(relativedelta(seconds=x))
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta

x = int(raw_input())
x = "{0.hours:02}:{0.minutes:02}:{0.seconds:02}".format(relativedelta(seconds=x))
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
from dateutil.relativedelta import relativedelta

x = int(raw_input())
x = "{0.hours}:{0.minutes}:{0.seconds}".format(relativedelta(seconds=x))
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))

Buggy python submission (verdict: Runtime Error):
x = int(raw_input())
x = "{0.hours}:{0.minutes}:{0.seconds}".format(relativedelta(seconds=x))
print(x)


Fixed submission:
x = int(raw_input())
m = x/60
h = m/60
m = m%60
s = x%60
print(str(h)+":"+str(m)+":"+str(s))
Buggy python submission (verdict: Runtime Error):
x = raw_input()
r = int(x)
s = r * r * 3.14159265359
l = 2 * r * 3.14159265359
print "%.6f %.6f" % (s,l)


Fixed submission:
x = raw_input()
r = float(x)
s = r * r * 3.14159265359
l = 2 * r * 3.14159265359
print "%.6f %.6f" % (s,l)

Buggy python submission (verdict: Runtime Error):
x = raw_input()
r = int(x)
s = r * r * 3.14159265359
l = 2 * r * 3.14159265359
print "%.6f %.6f" % (s,l)


Fixed submission:
x = raw_input()
r = float(x)
s = r * r * 3.14159265359
l = 2 * r * 3.14159265359
print "%.6f %.6f" % (s,l)
Buggy python submission (verdict: Runtime Error):
while(1):
    x = raw_input()
    x = x.split(" ")
    if(x == "0 ? 0"):
        break
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    if(op == "+"):
        print a+b
    elif(op == "-"):
        print a-b
    elif(op == "*"):
        print a*b
    elif(op == "/"):
        print a/b



Fixed submission:
while(1):
    x = raw_input()
    x = x.split(" ")
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    if(op == "?"):
        break
    elif(op == "+"):
        print a+b
    elif(op == "-"):
        print a-b
    elif(op == "*"):
        print a*b
    elif(op == "/"):
        print a/b

Buggy python submission (verdict: Runtime Error):
while(1):
    x = raw_input()
    x = x.split(" ")
    if(x == "0 ? 0"):
        break
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    if(op == "+"):
        print a+b
    elif(op == "-"):
        print a-b
    elif(op == "*"):
        print a*b
    elif(op == "/"):
        print a/b


Fixed submission:
while(1):
    x = raw_input()
    x = x.split(" ")
    a = int(x[0])
    op = str(x[1])
    b = int(x[2])
    if(op == "?"):
        break
    elif(op == "+"):
        print a+b
    elif(op == "-"):
        print a-b
    elif(op == "*"):
        print a*b
    elif(op == "/"):
        print a/b
Buggy python submission (verdict: Runtime Error):
while(1):
    count =0
    inp = raw_input().split(" ")
    if inp == "0 0":
        break
    for i in range(1,int(inp[0])+1):
        for j in range(1,int(inp[0])+1):
            if i != j:
                sum = i + j
                if sum == int(inp[1]):
                    count += 1
    print count


Fixed submission:
# coding: UTF-8
def find_comb(n,x):
    count = 0
    #探索
    for i in range(1,n-1):
        for j in range(i+1,n):
            k = x - i - j #←がi < j < k <= nを満たせばその時点で総和がxとなる
            if  j < k <= n:
                count += 1
    print count
while(1):
    n,x = map(int, raw_input().split(" "))
    if(n == 0 and x == 0):
        break
    find_comb(n,x)
Buggy python submission (verdict: Runtime Error):
# coding: UTF-8
alfa_list = [chr(i) for i in range(97, 97+26)]
count_list = []
lines = []
while(1):
    read_line = raw_input()
    if read_line == '':
        break
    lines.append(read_line)
char_line = str(lines).lower()
for ch in alfa_list:
    count_list.append(char_line.count(ch))
for i in range(26):
    print "{0} : {1}".format(alfa_list[i],count_list[i])


Fixed submission:
# coding: UTF-8
alfa_list = [chr(i) for i in range(97, 97+26)]
lines = []
count = 0
while(1):
    try:
        lines.append(str(raw_input()).lower())
    except:
        break
for ch in alfa_list:
    print "{0} : {1}".format(alfa_list[count],str(lines).count(ch))
    count += 1
Buggy python submission (verdict: Time Limit Exceeded):
class PriorityQueue:

    def __init__(self):
        self.q = {}

    def insert(self, k):
        self.q[k] = self.q.get(k, 0) + 1

    def extractMax(self):
        result = max(self.q)
        self.q[result] -= 1
        if self.q[result] == 0:
            del self.q[result]
        return result


if __name__ == '__main__':

    q = PriorityQueue()
    while True:
        al = input().split()

        if al[0] == "insert":
            q.insert(int(al[1]))
        elif al[0] == "extract":
            print(q.extractMax())
        elif al[0] == "end":
            break



Fixed submission:
import heapq

heap = []

while True:

    inst = input()
    if inst[0] == "i":
        heapq.heappush(heap, -int(inst[7:]))
    elif inst[1] == "x":
        print(-heapq.heappop(heap))
    else:
        break
Buggy python submission (verdict: Runtime Error):
l=map(int,raw_input().split())
n=raw_input()
ans=chk=0
 
 
def rolling(word,dice):
    if word=='S':
        dice[0],dice[1],dice[5],dice[4]=dice[4],dice[0],dice[1],dice[5]
    elif word=='N':
        dice[0],dice[1],dice[5],dice[4]=dice[1],dice[5],dice[4],dice[0]
    elif word=='W':
        dice[0],dice[2],dice[5],dice[3]=dice[2],dice[5],dice[3],dice[0]
    else:
        dice[0],dice[2],dice[5],dice[3]=dice[3],dice[0],dice[2],dice[5]
    return dice
 
for i in n:
    l=rolling(i,l)
print l[0]


Fixed submission:
class dice:

    def __init__(self, numlist):
        self._men = {"T": numlist[0],
                     "B": numlist[5],
                     "N": numlist[4],
                     "S": numlist[1],
                     "W": numlist[3],
                     "E": numlist[2]}

    def roll(self, direction):
        t = dict(self._men)

        if direction == "N":
            self._men["T"] = t["S"]
            self._men["B"] = t["N"]
            self._men["N"] = t["T"]
            self._men["S"] = t["B"]
        elif direction == "S":
            self._men["T"] = t["N"]
            self._men["B"] = t["S"]
            self._men["S"] = t["T"]
            self._men["N"] = t["B"]
        elif direction == "W":
            self._men["T"] = t["E"]
            self._men["B"] = t["W"]
            self._men["W"] = t["T"]
            self._men["E"] = t["B"]
        elif direction == "E":
            self._men["T"] = t["W"]
            self._men["B"] = t["E"]
            self._men["W"] = t["B"]
            self._men["E"] = t["T"]


    def gettop(self):
        return self._men["T"]

def decode():
    numlist = [int(x) for x in input().split()]
    dlist = input()
    return numlist, dlist

if __name__ == '__main__':

    numlist, dlist = decode()
    d1 = dice(numlist)
    for c in dlist:
        d1.roll(c)
    print(d1.gettop())