TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
import sys
input = sys.stdin.readline

n = int(input())
s = [input() for _ in range(n)]


def bracket(x):
    # f: final sum of brackets '(':+1, ')': -1
    # m: min value of f
    f = m = 0
    for i in range(len(x)):
        if x[i] == '(':
            f += 1
        else:
            f -= 1
        m = min(m, f)
    # m <= 0
    return f, m


def func(l):
    # l = [(f, m)]
    l.sort(key=lambda x: -x[1])
    v = 0
    for fi, mi in l:
        if v + mi >= 0:
            v += fi
        else:
            return -1
    return v


l1 = []
l2 = []
for i in range(n):
    fi, mi = bracket(s[i])
    if fi >= 0:
        l1.append((fi, mi))
    else:
        l2.append((-fi, mi - fi))

v1 = func(l1)
v2 = func(l2)
if v1 == -1 or v2 == -1:
    ans = 'No'
else:
    ans = 'Yes' if v1 == v2 else 'No'

print(ans)


import sys
# input = sys.stdin.readline
input = lambda: sys.stdin.readline().rstrip()

n = int(input())
s = [input() for _ in range(n)]


def bracket(x):
    # f: final sum of brackets '(':+1, ')': -1
    # m: min value of f
    f = m = 0
    for i in range(len(x)):
        if x[i] == '(':
            f += 1
        else:
            f -= 1
        m = min(m, f)
    # m <= 0
    return f, m


l1 = []
l2 = []
for i in range(n):
    fi, mi = bracket(s[i])
    if fi >= 0:
        l1.append((fi, mi))
    else:
        l2.append((fi, mi))

l1.sort(key=lambda x: -x[1])
l2.sort(key=lambda x: -(x[0] - x[1]))
l = l1 + l2
v = 0
for fi, mi in l:
    if v + mi >= 0:
        v += fi
    else:
        v = -1
        break

ans = 'Yes' if v == 0 else 'No'
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
s = [readline().rstrip().decode() for _ in range(n)]
inc = []
dec = []
for ss in s:
    d, r = 0, 0
    for m in ss:
        d += 1 if s == '(' else -1
        r = max(r, -d)
    (dec if d < 0 else inc).append((d, r))
inc.sort(key=lambda x: x[1])
dec.sort(key=lambda x: x[0] + x[1])
p1 = 0
p2 = 0
flag = True
for i in inc:
    flag &= i[1] <= p1
    p1 += i[0]
for d in dec:
    flag &= p2 >= d[0] + d[1]
    p2 -= d[0]
print('Yes' if flag and p1 == p2 else 'No')


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
s = [readline().rstrip().decode() for _ in range(n)]
inc = []
dec = []
for ss in s:
    d, r = 0, 0
    for m in ss:
        d += (1 if s == '(' else -1)
        r = max(r, -d)
    (dec if d < 0 else inc).append((d, r))
inc.sort(key=lambda x: x[1])
dec.sort(key=lambda x: x[0] + x[1])
p1 = 0
p2 = 0
flag = True
for i in inc:
    flag &= i[1] <= p1
    p1 += i[0]
for d in dec:
    flag &= p2 >= d[0] + d[1]
    p2 -= d[0]
print('Yes' if flag and p1 == p2 else 'No')


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
inc = []
dec = []
for _ in range(n):
    s = readline().rstrip().decode()
    d, r = 0, 0
    for m in s:
        d += (1 if m == '(' else -1)
        r = max(r, -d)
    (dec if d < 0 else inc).append((d, r))
inc.sort(key=lambda x: x[1])
dec.sort(key=lambda x: x[0] + x[1])
p1 = 0
p2 = 0
flag = True
for i in inc:
    flag &= i[1] <= p1
    p1 += i[0]
for d in dec:
    flag &= p2 >= d[0] + d[1]
    p2 -= d[0]
flag &= p1 == p2
print('Yes' if flag else 'No')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
#from collections import defaultdict, deque
#import itertools
#import numpy as np
#import re

def main():
    N = int(input())
    SS = []
    for _ in range(N):
        SS.append(input())
    S = []
    for s in SS:
        while '()' in s:
            s = s.replace('()', '')
        S.append(s)
    #print(S)
    S = [s for s in S if s != '']
    sum_op = 0
    sum_cl = 0
    S_both_op = []
    S_both_cl = []
    for s in S:
        if not ')' in s:
            sum_op += len(s)
        elif not '(' in s:
            sum_cl += len(s)
        else:
            pos = s.find('(')
            if pos <= len(s) - pos:
                S_both_op.append((pos, len(s)-pos))  
            else:
                S_both_cl.append((pos, len(s)-pos))  

    
    sort(S_both_op, key=lambda x: x[0])  
    sort(S_both_cl, key=lambda x: x[0])  

    for p in S_both_op:
        sum_op -= p[0]
        if(sum_op < 0 ):
            print('No')
            exit()
        sum_op += p[1]
    for p in S_both_cl:
        sum_op -= p[0]
        if(sum_op < 0 ):
            print('No')
            exit()
        sum_op += p[1]
    
    if sum_op == sum_cl:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

#from collections import defaultdict, deque
#import itertools
#import numpy as np
#import re
import bisect

def main():
    N = int(input())
    SS = []
    for _ in range(N):
        SS.append(input())
    S = []
    for s in SS:
        while '()' in s:
            s = s.replace('()', '')
        S.append(s)
    #print(S)
    S = [s for s in S if s != '']
    sum_op = 0
    sum_cl = 0
    S_both_op = []
    S_both_cl = []
    for s in S:
        if not ')' in s:
            sum_op += len(s)
        elif not '(' in s:
            sum_cl += len(s)
        else:
            pos = s.find('(')
            if pos <= len(s) - pos:
                S_both_op.append((pos, len(s)-pos))  
            else:
                S_both_cl.append((pos, len(s)-pos))  

    
    
    
    S_both_op.sort(key=lambda x: x[0])
    S_both_cl.sort(key=lambda x: -x[1])

    for p in S_both_op:
        sum_op -= p[0]
        if(sum_op < 0 ):
            print('No')
            exit()
        sum_op += p[1]

    for p in S_both_cl:
        sum_op -= p[0]
        if(sum_op < 0 ):
            print('No')
            exit()
        sum_op += p[1]
    
    if sum_op == sum_cl:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
dicpos = {}
dicneg = {}

N = int(input())
for i in range(N):
  buf = [0]
  for s in input():
    if s=="(":
      buf.append(buf[-1] + 1)
    else:
      buf.append(buf[-1] - 1)
  low = min(buf)
  last = buf[-1]
  if last>0:
    if low in dicpos:
      dicpos[low].append(last)
    else:
      dicpos[low] = [last]
  else:
    if low in dicneg:
      dicneg[low].append(last)
    else:
      dicneg[low] = [last]
neg_sorted = sorted(dicneg.items(), key=lambda x:x[0])
pos_sorted = sorted(dicpos.items(), key=lambda x:x[0], reverse=True)
print(neg_sorted)
print(pos_sorted)
summ = 0
flag = 0
for i in pos_sorted:
  for j in i[1]:
    if summ + i[0] < 0:
      flag = 1
      print("No")
      break
    summ += j
if flag == 0:
  for i in neg_sorted:
    for j in sorted(i[1], reverse=True):
      if summ + i[0] < 0:
      	flag = 1
      	print("No")
      	break 
      summ += j
if flag == 0:
  if summ == 0:
    print("Yes")
  else:
    print("No")

dicpos = {}
dicneg = {}

N = int(input())
for i in range(N):
  buf = [0]
  for s in input():
    if s=="(":
      buf.append(buf[-1] + 1)
    else:
      buf.append(buf[-1] - 1)
  low = min(buf)
  last = buf[-1]
  if last>0:
    if low in dicpos:
      dicpos[low].append(last)
    else:
      dicpos[low] = [last]
  else:
    if low-last in dicneg:
      dicneg[low-last].append(-last)
    else:
      dicneg[low-last] = [-last]
neg_sorted = sorted(dicneg.items(), key=lambda x:x[0], reverse=True)
pos_sorted = sorted(dicpos.items(), key=lambda x:x[0], reverse=True)


summ = 0
flag = 0
for i in pos_sorted:
  if flag == 1:
    break
  for j in i[1]:
    if summ + i[0] < 0:
      flag = 1
      print("No")
      break
    summ += j
summ2 = 0
if flag == 0:
  for i in neg_sorted:
    if flag == 1:
      break
    for j in i[1]:
      if summ2 + i[0] < 0:
        flag = 1
        print("No")
        break
      summ2 += j
if flag == 0:
  if summ == summ2:
    print("Yes")
  else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
print('No')







def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    a = []
    b = []
    for _ in range(n):
        s = input().rstrip()
        
        up, down = 0, 0
        for i in s:
            if i == ')':
                up -= 1
                if down > up:
                    down = up
            else:
                up += 1
        if up >= 0:
            a.append((down, up))
        else:
            b.append((up-down, down, up))

    a.sort(reverse=True)
    b.sort(key=lambda a: a[0],reverse=True)

    c = 0

    for d, u in a:
        if c+d < 0:
            print('No')
            break
        else:
            c += u
    else:
        for _, d, u in b:
            if c+d < 0:
                print('No')
                break
            else:
                c += u
        else:
            if c == 0:
                print('Yes')
            else:
                print('No')
    
if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
n=int(input())
po,ne=[],[]
now=0
for i in range(n):
    p=0
    mp=0
    for j in input():
        p+=(1,-1)[j==")"]
        mp=min(p,mp)
    if mp:
        if p>=0:
            po.append((mp,p))
        else:ne.append((mp-p,-p))
    else:now+=p
po.sort(reverse=1)
ne.sort(reevrse=1)
for m,p in po+ne:
    if m+now<0:print("No");exit()
    else:now+=p
print("No") if now else print("Yes")

n=int(input())
po,ne=[],[]
now=0
for i in range(n):
    p=0
    mp=0
    for j in input():
        p+=(1,-1)[j==")"]
        mp=min(p,mp)
    if mp:
        if p>=0:
            po.append((mp,p))
        else:ne.append((mp-p,-p))
    else:now+=p
po.sort(reverse=1)
ne.sort(reverse=1)
for m,p in po:
    if m+now<0:print("No");exit()
    else:now+=p
nnow=0
for m,p in ne:
    if m+nnow<0:print("No");exit()
    else:nnow+=p
print("Yes" if now==nnow else "No") 

Verdicts: Runtime Error

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
import sys
input = sys.stdin.readline

N = int(input())

S = [input() for _ in range(N)]
S_p = []
S_n = []

for i in range(N):
  end = 0
  mim = 0
  for j in range(len(S[i])):
    if S[i][j] == "(":
      end += 1
    else :
      end -= 1
    mim = min(mim,end)
  
  if end >= 0:
    S_p.append((mim, end))
  else:
    S_n.append((end-mim, end))
  
S_p.sort(reverse=True)
S_n.sort(reverse=True)
#print(S_p)
#print(S_n)

check = 0
flag = True
for i in range(len(S_p)):
  if check + S_p[i][0] >= 0:
    check += S_p[i][1]
  else:
    flag = False
    break
  #print(check)
  
for i in range(len(S_n)):
  if check + S_n[i][1] - S_n[i][0] >= 0:
    check += S_n[i][1]
  else:
    flag = False
    break
  #print(check)
  
if check == 0 and flag:
  flag = True
else:
  flag = False

print("Yes" if flag else "No")

N = int(input())

S = [input() for _ in range(N)]
S_t = [(0,0) for _ in range(N)]

for i in range(N):
  end = 0
  mim = 0
  for j in range(len(S[i])):
    if S[i][j] == "(":
      end += 1
    else :
      end -= 1
    mim = min(mim,end)
  
  S_t[i] = (mim, end)
  
S_t.sort(reverse=True)
print(S_t)

check = 0
flag = True
for i in range(N):
  if check + S_t[i][0] >= 0:
    check += S_t[i][1]
  else:
    flag = False
    break
  print(check)
    
if check == 0 and flag:
  flag = True
else:
  flag = False

print("Yes" if flag else "No")

import sys
input=lambda: sys.stdin.readline().rstrip()

N = int(input())

S_p = []
S_n = []

for i in range(N):
  end = 0
  mim = 0
  for c in input():
    if c == "(":
      end += 1
    else :
      end -= 1
    mim = min(mim,end)
  
  if end >= 0:
    S_p.append([mim, end])
  else:
    S_n.append([end-mim, end])
  
S_p.sort(reverse=True)
S_n.sort(reverse=True)
#print(S_p)
#print(S_n)

check = 0
flag = True
for i in range(len(S_p)):
  if check + S_p[i][0] >= 0:
    check += S_p[i][1]
  else:
    flag = False
    break
  #print(check)
  
for i in range(len(S_n)):
  if check + S_n[i][1] - S_n[i][0] >= 0:
    check += S_n[i][1]
  else:
    flag = False
    break
  #print(check)
  
if check == 0 and flag:
  flag = True
else:
  flag = False

print("Yes" if flag else "No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
import sys
readline = sys.stdin.readline

def resolve():
    N = int(readline())
    S = [readline().strip() for i in range(N)]
    L,R = [],[]
    D = []
    for i in range(N):
        L_R = [0,0] 
        for i in S:
            if i == ")":
                if L_R[1] > 0 :
                    L_R[1] -= 1
                else:
                    L_R[0] +=1
            if i == "(":
                L_R[1] += 1
            if L_R[0] == 0 and L_R[1] == 0:
                pass
            elif L_R[0] == 0:
                R.append(L_R[1])
            elif L_R[1] == 0:
                L.append(L_R[0])
            else:
                D.append((L_R))
    L = sum(L)
    R = sum(R)

    inc = []
    dec = []
    for l,r in D:
        if l > r:
            inc.append((l, r))
        else:
            dec.append((l, r))
    
    inc.sort(key=lambda x:x[1])
    dec.sort(key=lambda x:-x[1])
    
    D = inc + dec
    
    for i, (l,r) in enumerate(D):
        L -= r
        if L < 0:
            print('No')
            exit(0)
        L += l
    
    if L == R:
        print('Yes')
    else:
        print('No')
resolve()



import sys
readline = sys.stdin.readline

def resolve():
    N = int(readline())
    S = [readline().strip() for i in range(N)]
    L,R = [],[]
    D = []
    for s in S:
        l, r = 0, 0
        for c in s:
            if c == ')':
                if l > 0:
                    l -= 1
                else:
                    r += 1
            else:
                l += 1
        if l == 0 and r == 0:
            pass
        elif l == 0:
            R.append(r)
        elif r == 0:
            L.append(l)
        else:
            D.append((l, r))
    L = sum(L)
    R = sum(R)

    inc = []
    dec = []
    for l,r in D:
        if l > r:
            inc.append((l, r))
        else:
            dec.append((l, r))
    
    inc.sort(key=lambda x:x[1])
    dec.sort(key=lambda x:-x[1])
    
    D = inc + dec
    
    for i, (l,r) in enumerate(D):
        L -= r
        if L < 0:
            print('No')
            exit(0)
        L += l
    
    if L == R:
        print('Yes')
    else:
        print('No')
resolve()

Verdicts: Wrong Answer

Accepted
Problem: A **bracket sequence** is a string that is one of the following:    1. An empty string;   2. The concatenation of `(`, A, and `)` in this order, for some bracket sequence A ;   3. The concatenation of A and B in this order, for some non-empty bracket sequences A and B /  Given are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?

Submission attempts (in order):
n = int(input())
S = [input() for i in range(n)]
AB = []
for i in range(n):
    a, b = 0, 0
    for c in S[i]:
        if c == '(':
            b += 1
        if c == ')':
            if b > 0:
                b -= 1
            else:
                a += 1
    AB.append((a, b))
AB0 = [(a, b) for a, b in AB if -a + b >= 0]
AB1 = [(a, b) for a, b in AB if -a + b < 0]
AB0.sort()
AB1.sort(key=lambda x: -x[1])
AB = AB0 + AB1
print(AB)
x = 0
for a, b in AB:
    x -= a
    if x < 0:
        print('No')
        exit()
    x += b
if x == 0:
    print('Yes')
else:
    print('No')


n = int(input())
S = [input() for i in range(n)]
AB = []
for i in range(n):
    a, b = 0, 0
    for c in S[i]:
        if c == '(':
            b += 1
        if c == ')':
            if b > 0:
                b -= 1
            else:
                a += 1
    AB.append((a, b))
AB.sort(key=lambda x: (x[0], -x[1]))
print(AB)
x = 0
for a, b in AB:
    x -= a
    if x < 0:
        print('No')
        exit()
    x += b
if x == 0:
    print('Yes')
else:
    print('No')


n = int(input())
L, R = [], []
for i in range(n):
    a, b = 0, 0
    for c in input():
        if c == '(':
            b += 1
        if c == ')':
            if b > 0:
                b -= 1
            else:
                a += 1
    if -a + b > 0:
        L.append((a, b))
    else:
        R.append((a, b))
L.sort(key=lambda x: x[0])
R.sort(key=lambda x: x[1], reverse=True)
x = 0
for a, b in L + R:
    x -= a
    if x < 0:
        print('No')
        exit()
    x += b
if x == 0:
    print('Yes')
else:
    print('No')


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
#A
s = input()

if s == ABC:
    print('ARC')
else:
    print('ABC')

#A
s = input()

if s == ABC:
    print('ARC')
else:
    print('ABC')

#A
s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = input()

if S is "ABC":
  print("ARC")
else:
  print("ABC")

S = input()

if S == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = str(input())
if S = "ABC":
  print("ARC")
else:
  print("ABC")

S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
from sys import stdin
input = stdin.readline

from collections import deque

X = int(input())
s = {}
q = deque()

q.append([1, 0])
while True:
	ab = q.popleft()
	tmp = ab[0] ** 5 - ab[1] ** 5
	if (tmp == X):
		print(ab[0], ab[1])
		quit()
	elif (tmp > X):
		q.append([ab[0] - 1, ab[1]])
		q.append([ab[0], ab[1] - 1])
	else:
		q.append([ab[0] + 1, ab[1]])
		q.append([ab[0], ab[1] - 1])


from sys import stdin
input = stdin.readline

s = input()

if s == 'ABC':
	print('ARC')
else:
	print('ABC')


#from sys import stdin
#input = stdin.readline

s = input()

if s == 'ABC':
	print('ARC')
else:
	print('ABC')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S='ABC'
if S='ABC':
  print('ARC')
else:
  print('ABC')

S=input('S')
if S='ABC':
  print('ARC')
else:
  print('ABC')

S=input()
if S is 'ABC':
  print('ARC')
else:
  print('ABC')

S=input()
if 'B' in S:
  print('ARC')
else:
  print('ABC')

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = input()
print('ABC' if s == 'ARC' else 'ABC')

s = input()
print('ABC' if s == 'ARC' else 'ARC')

Verdicts: Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S=input()split()
if S=="ABC":
    print("ARC")
else:
    print("ABC")

#A,B=map(input().split())
S=input().split()
if S=="ABC":
    print("ARC")
else:
    print("ABC")

S=input()
if S=="ABC":
    print("ARC")
else:
    print("ABC")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = input().split()
if s == "ABC":
  print("ARC")
elif s == "ARC":
  print("ABC")
 

S = str(input().split())
if S == "ABC":
  print("ARC")
elif S == "ARC":
  print("ABC")

s = str, input().split()
if s == "ABC":
  print("ARC")
elif s == "ARC":
  print("ABC")

S = input()
if S == "ABC":
  print("ARC")
else :
  print("ABC")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
if int(input())==ABC:
  print("ARC")
else :
  print("ABC")

if input()=="ABC":
  print("ARC")
else :
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S=list(map(int, input().split()))
if S=='ARC':
  print("ABC")
else:
  print("ARC")

S=input()
if S=="ARC":
  print("ABC")
else:
  print("ARC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = 'ABC' or 'ARC'
print(S)

if (S == 'ABC'):
    print('ARC')
else:
    print('ABC')

S = input()#ABC or ARC

if (S == 'ABC'):
    print('ARC')
else:
    print('ABC')

Verdicts: Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = input()
if s = "ABC":
  print("ARC")
else:
  print("ABC")

s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
last_name = input()
last_type = last_name[:3]

if last_type == "ABC":
  return "ARC"
else:
  return "ABC"

last_name = input()
last_type = last_name[:3]
 
if last_type == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = str(input())

if S == ABC:
  print("ARC")
else:
  print("ABC")

S = str(input())

if S == 'ABC':
    print("ARC")
else:
    print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = input()

if S == ABC:
    print("ARC")
else:
    print("ABC")

S = input()

if S == "ABC":
    print("ARC")
else:
    print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s=input()
if s==ABC:
  print("ARC")
else:
  print("ABC")
   

s=input()
if s=="ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
x = int(input())

for i in range(1000):
    #for j in range(10)
    #print(i ** 5)
    for j in range(1000):
        #print(i ** 5 - j ** 5)
        if i ** 5 - j ** 5 == x:
            print(i, j)
            quit()
        elif i ** 5 - (-j) ** 5 == x:
            print(i, -j)
            quit()
        elif (-i) ** 5 - j ** 5 == x:
            print(-i, j)
            quit()
        elif (-i) ** 5 - (-j) ** 5 == x:
            print(-i, -j)
            quit()


s = input()
if s == 'ABC':
    print('ARC')
else:
    print('ABC')

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
from sys import exit

x=int(input())
for i in range(0,201):
	for j in range(-200,i):
		if i**5-j**5==x:
			print(i,j)
			exit()

s=input()
if s=="ABC":
	print("ARC")
else:
	print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):

if S == "ABC":
  print("ARC")
else:
  print("ABC")


if S == "ABC":
  return "ARC"
else:
  return "ABC"

S = input()
if S == "ABC":
  print "ARC"
else:
  print "ABC"

S = input()
if S == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
N, M = list(map(int, input().split()))

H = list(map(int, input().split()))

ans = [1]*N

for i in range(M):
    A, B = list(map(int, input().split()))
    if H[A-1] > H[B-1]:
        ans[B-1] = 0
    elif H[A-1] < H[B-1]:
        ans[A-1] = 0
    else:
        ans[A-1] = 0
        ans[B-1] = 0

print(sum(ans))

import sys
S = input()

if S == "ABC":
    print("ARC")
    sys.exit()
else:
    print("ABC")
    sys.exit()


Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = input("ABC")
if S == 'ABC':
    print('ARC')
else:
    print('ABC')

S = input()
if S == 'ABC':
    print('ARC')
else:
    print('ABC')

Verdicts: Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
n,m = map(int,input().split())
height = list(map(int,input().split()))
lst = [0]*n
for j in range(m):
    x,y = map(int,input().split())
if height[x-1] >= height[y-1]:
    lst[y-1] = 1
if height[x-1] <= height[y-1]:
    lst[x-1] = 1
print(lst.count(0))

n,m = map(int,input().split())
height = list(map(int,input().split()))
lst = [0]*n
for j in range(m):
    x,y = map(int,input().split())
    if height[x-1] >= height[y-1]:
      lst[y-1] = 1
    if height[x-1] <= height[y-1]:
      lst[x-1] = 1
print(lst.count(0))

s = input()
if s == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s=str(input())
print(s)

s=str(input())
if s ="ARC":
  print("ABC")
else:
  print("ARC")

s=str(input())
if s =="ARC":
  print("ABC")
else:
  print("ARC")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = input()
if s == 'ABC:
	print('ARC')
else:
	print('ABC')  

s = input()
if s == 'ABC':
	print('ARC')
else:
	print('ABC')  

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = int(input())
if s == 'ABC':
  print('ARC')
else:
  print('ABC')

s = input()
if s == 'ABC':
  print('ARC')
else:
  print('ABC')

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S=input()
if S="ABC":
  print("ARC")
elif S="ARC":
  print("ABC")

S=input()
if S=="ABC":
  print("ARC")
elif S=="ARC":
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
if __name__ == '__main__':
	S = input()
	if S =='ABC':
		print('SRC')
	else:
		print('ABC')
	

if __name__ == '__main__':
	S = input()
	if S =='ABC':
		print('ARC')
	else:
		print('ABC')
	

Verdicts: Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S=input()
print("ABC" if S!="ABC" else S)

S=input()
print(S if S!="ABC" else "ABC")

S=input()
print("ARC" if S=="ABC" else "ABC")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = input()
if(s[1] == "R"):
  print("ABC")
 else:
  print("ARC")
  

s = input()
if(s[1] == "R"):
  print("ABC")
else:
  print("ARC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = str(input())
if S == 'ABC'
	print('ARC')
else S == 'ARC'
	print('ABC')

S = str(input())
if S == 'ABC'
	print('ARC')
elif S == 'ARC'
	print('ABC')

S = str(input())
if S == 'ABC'
	print('ARC')
else S == 'ARC'
	print('ABC')

S = str(input())
if S == 'ABC'
	print('ARC')
else
	print('ABC')

S = str(input())
if S == 'ABC':
	print('ARC')
else:
	print('ABC')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
import sys
input = sys.stdin.readline

strA = str(input())

if strA == 'ABC':
  print('ARC')
elif strA == 'ARC':
  print('ABC')
else:
  print('')

import sys
input = sys.stdin.readline

hoge = str(input())

if hoge == 'ARC':
  print('ABC')
elif hoge == 'ABC':
  print('ARC')

import sys
input = sys.stdin.readline

strA = str(input())


if strA == 'ABC':
  print('ARC')
elif strA == 'ARC':
  print('ABC')


import sys
input = sys.stdin.readline

strA = str(input())

if strA == 'ABC':
  print('ARC')
else:
  print('ABC')


import sys
input = sys.stdin.readline

strA = str(input())

if strA == 'ABC':
  print('ARC')
elif strA == 'ARC':
  print('ABC')
else
  print('')

import sys
input = sys.stdin.readline

strA = str(input())

if strA == 'ABC':
  print('ARC')
if strA == 'ARC':
  print('ABC')


import sys

import math
input = sys.stdin.readline

hoge = str(input().strip())
if hoge == "ABC":
   print("ARC".strip())
if hoge == "ARC":
       print("ABC".strip())

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
N = int(input())
p = list(map(int, input().split()))
sum = [i + 1 + x for i, x in enumerate(p)]
dif = [i + 1 - x for i, x in enumerate(p)]
ans = 0

for i in range(N):
    ans += sum.count(dif[i])

print(ans)

S = input()
if S == "ABC":
    print("ARC")
else:
    print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
S = "ABC"
S = "ARC"

if S = "ABC":
  print "ARC"
else:
  print "ABC"

S = "ABC" or "ARC"

ABC = S
ARC = S

if S = "ABC"{
  print("ARC")
}else{
  print("ABC")
             

S = input()

if S == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):

n = input()

if n == ABC:
    print("ARC")
else:
    print("ABC")


n = input()

if n == "ABC":
    print("ARC")
else:
    print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
x = input()

if x = "ABC":
  print("ARC")
else:
  print("ABC")

x = input()

if x == "ABC":
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s = input().split()
if(s = 'ABC'):
  print("ARC")
else:
  print("ABC")

s= map.input()
if(s == "ABC"):
  print("ARC")
else:
  print("ABC")

s= input()
if(s == "ABC"):
  print("ARC")
else:
  print("ABC")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
printt('ARC' if input()=='ABC' else 'ABC')

x = int(input())
for i in range(-102,103):
    for j in range(-102,103):
        if (i**5)-(j**5)==x:
            print(i,j)
            exit()


mycode

print('ARC' if input()=='ABC' else 'ABC')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
for okashi_number in range(k):
	di = int(input())
	D = map(int,input().split())
	for x in range(di)
		A[[x]-1] = 1

for i in range(N):
	if A[i] == 0:
	print(A[i])


S = input()

if S == "ABC":
	print("ARC")
else:
	print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
n, m = list(map(int, input().split()))
hs = list(map(int, input().split()))
ans = [1]*n
for i in range(m):
    road = list(map(int, input().split()))
    if hs[road[0]-1] <= hs[road[1]-1]:
        ans[road[0]-1] = 0
    if hs[road[0]-1] >= hs[road[1]-1]:
        ans[road[1]-1] = 0
print(ans.count(0))


s = input()
if s == "ABC":
    print("ARC")
else:
    print("ABC")

Verdicts: Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
x = int(input())
for a in range(-10000, 10000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

x = int(input())
for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

s = input()
print('ABC' if s == 'ARC' else 'ARC')


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: AtCoder Inc. holds a contest every Saturday.  There are two types of contests called ABC and ARC, and just one of them is held at a time.  The company holds these two types of contests alternately: an ARC follows an ABC and vice versa.  Given a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.

Submission attempts (in order):
s=input()

if s == "ABC":
  print(s)
else:
  print("ARC")


s=input()
 
if s == "ARC":
  print("ABC")
else:
  print("ARC")

Verdicts: Wrong Answer

Accepted