Problem:


Score : 100 points

Problem Statement

A programming competition site AtCode regularly holds programming contests.

The next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.

The contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.

The contest after the ARC is called AGC, which is rated for all contestants.

Takahashi's rating on AtCode is R. What is the next contest rated for him?

Constraints

0 ≤ R ≤ 4208

R is an integer.

Input

Input is given from Standard Input in the following format:

R

Output

Print the name of the next contest rated for Takahashi (ABC, ARC or AGC).

Sample Input 1

1199

Sample Output 1

ABC

1199 is less than 1200, so ABC will be rated.

Sample Input 2

1200

Sample Output 2

ARC

1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.

Sample Input 3

4208

Sample Output 3

AGC



Sample input:
1199


Sample output:
ABC

Submission status: Runtime Error

Solution code:
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]


def dfs(i, sum, count, nokori):
    global ans
    if i == d:#全ての最後の問題セットにたどり着いたら,　全ての葉を確認
        if sum < g:
            use = max(nokori)#選んでいない種類で最大のスコアの問題を選ぶ
            #-(-(g-sum)//(use*100)) <- (g-sum)//(use*100)
            n = min(pc[use-1][0], -(-(g-sum)//(use*100)))#その難易度の問題の数 または 残りの必要スコア/その難易度の問題1問の点数　の最小値をとる->余計に問題を解かない＆問題数を超えてとかない
            count += n
            sum += n * use * 100

        if sum >= g:#全ての葉の達成してる最小の答えを記録
            ans = min(ans, count)

    else:
        dfs(i+1, sum, count, nokori)#選ばなかった場合
        dfs(i+1, sum + pc[i][0] * (i+1) * 100 + pc[i][1], count + pc[i][0], nokori - {i+1})#全て解いた番号をセットから抜いて、合計&countを更新

ans = float("inf")
dfs(0, 0, 0, set(range(1, d+1)))
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
if a<1200:
  print("ABC")
else if 2800<=a:
  print("AGC")
else:
  print("ARC")

Submission status: Runtime Error

Solution code:
=int(input())
if a<1200:
  print("ABC")
elif 2800<=a:
  print("AGC")
else:
  print("ARC")

Submission status: Runtime Error

Solution code:
=int(input())
if a<1200:
  print("ABC")
else if 2800<=a:
  print("AGC")
else:
  print("ARC")

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    prnit('AGC')

Submission status: Runtime Error

Solution code:
r=input()
if r<1200:
  print("ABC")
elif r<2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        # for i in additional_:
        #     if i[1] > 1:
        #         add_score = i
        #         break

        add_score = additional_[0]

        for k in range(add_score[1]-1):
            score += add_score[0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)

Submission status: Runtime Error

Solution code:
n=int(input())
if n<1200:
  print("ABC")
elif:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
P=[]
C=[]
point=1001    #全問題数

D,G=map(int,input().split())
for i in range(D):
    p,c= map(int,input().split())
    P.append(p)
    C.append(c)

#とりあえず全部解くor解かないで目標スコアを超えるか超えないかを考える


for i in range(2**D) :
    score=0
    solve=0
    needproblem=0
    for j in range(D) :                  #全正解した大問をスコアに変換
        if (i>>j) & 1 :
            score+=P[j]*100*(j+1)+C[j]
            solve+=P[j]
        if (~i>>j) & 1 :                  #1問も解かなかった問題の中で最も一題あたりの点が高い問題
            needproblem=j+1
    if score>=G :
        point=min(point,solve)

#ぎりぎりスコアが届いていない場合、1問も解かなかった問題の中で最も一題あたりの点が高い問題だけ解いてみる
#中途半端に大問を解ききるのが１種類以下でも目標に届く場合もあるという予想

    elif score<G :                
        needsolve=(G-score)//(needproblem*100)
        if needsolve>P[needproblem-1] :            #1問も解かなかった問題の中で最も一題あたりの点が高い問題を解いても届かないのでやり直し
            continue
        elif needsolve<P[needproblem-1] :
            resolve=solve+needsolve+1
            point=min(point,resolve)

print(point)

Submission status: Runtime Error

Solution code:
r = input()

if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

public class main {
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        if(r < 1200){
            System.out.println("ABC");
        }else if(1200 <= r && r < 2800){
            System.out.println("ARC");
        } else{
            System.out.println("AGC");
        }
    }
}

Submission status: Runtime Error

Solution code:
R = input()

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
(d, g), *s = [list(map(int, i.split())) for i in open(0)]
s = [[i[0] * -~n * 100 + i[1], i[0]] for n, i in enumerate(s)]
a = 10**3
for b in range(1 << d):
    su = sum(s[i][0] * (b >> i & 1) for i in range(d))
    n = sum(s[i][1] * (b >> i & 1) for i in range(d))
    if su <= g:
        m = d-bin(b)[2:].zfill(d).find("0")
        e =-~(g-su)//(m*100)
        if e < s[m-1][1]:
            a = min(a,n + e)
    if su > g:
        a = min(a,n)
print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
print('ABC') if n<1200 elif n<2800 print('ARC') else print('AGC')

Submission status: Runtime Error

Solution code:
n=int(input())
print('ABC') if n<1200 else if n<2800 print('ARC') else print('AGC')

Submission status: Runtime Error

Solution code:
d, g = map(int, input().split())
pc = [tuple(map(int, input().split())) for i in range(d)]

ans = float('inf')

for i in range(2**d):
    sum = 0
    cnt = 0
    nokori = set(range(1, d+1))
    for j in range(d):
        bitchk = 2**j
        if i & bitchk:
            sum += pc[j][0]*100*(j+1) + pc[j][1]
            cnt += pc[j][0]
            nokori.discard(j+1)
    if sum < g:
        use = max(nokori)
        # -(-(g-sum)//(use*100))は切り上げ除算
        # pc[use-1][0]はその点数帯の問題数（解ける最大数）
        # -(-(g-sum)//(use*100))でgを超えるのに必要な問題数を出せる。
        # ex) 300点問題が4問残ってるとする。不足している点数(g-sum)が500点のとき
        # -(-500//300)で2問解く必要があることがわかる。
        n = min(pc[use-1][0], -(-(g-sum)//(use*100)))
        # n = (-(-(g-sum)//(use**100)))
        sum += n * use * 100
        cnt += n

    if sum >= g:
        ans = min(ans, cnt)

print(ans)

Submission status: Runtime Error

Solution code:
D,G = map(int, input().split())
pc = [list(map(int,input().split())) for _ in range(D)]

ans = 1 << 29
t = []
for bit in range(1<<D):
    score = 0
    f = 0
    # フラグが立ってる問題を全完
    for i in range(D):
        if bit & (1<<i):
            score += pc[i][0]*100*(i+1) + pc[i][1]
            f += pc[i][0]
            if score >= G: break
    # 全完した問題以外の中から点数の高い順に解いていく
    nokori = []
    for j in range(D):
        if not (bit & (1<<j)):
            nokori.append(pc[j] + [j+1])
    nokori = list(reversed(nokori))
    for d in nokori:
        for x in range(d[0]):
            if score >= G: break
            score += 100*(d[2])
            f += 1
        if score >= G: break
    ans = min(ans,f)
print(ans)

Submission status: Runtime Error

Solution code:
r = int(input().split())
if r < 1200:
    print('ABC')
elif r < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
d , g = map(int , input().split())
p = [0] * d
c = [0] * d
for i in range(d):
    p[i] , c[i] = map(int , input().split())

ans = float("inf")

for bit in range(1<<d):
  sum=0
  count=0
  nokori=set(range(1,d+1))
  for i in range(d):
    if bit&(1<<i):
      sum += p[i]*100*(i+1)+c[i]
      count+= p[i]
      nokori.discard(i + 1)
  if sum<g:
    a=g-sum
    num=max(nokori)
    n=min(p[num-1],-(-a//(num*100)))
    count+=n
    sum+=n*num*100
  if sum>=g:
    ans=min(ans,count)
    
print(ans)

Submission status: Runtime Error

Solution code:
R = int(input())

print('ABC' if R <1200 else 'ARC' if N < 2800 else 'AGC')

Submission status: Runtime Error

Solution code:
d, g = map(int, input().split())

p = []
c = []

for i in range(d):
    pi, ci = map(int, input().split())
    p.append(pi)
    c.append(ci)

minp = sum(p)

def min_plobrem(p,c):
    res = []
    if len(p) == 1:
        for i in range(p[0]+1):
            point = 100 * d
            if i == p[0]:
                point += c[0]
            res.append([point,i])
            if point >= g:
                break
    else:
        for lelse in min_plobrem(p[1:],c[1:]):
            for i in range(p[0]+1):
                point = 100 * (d-len(p)+1) * i
                if i == p[0]:
                    point += c[0]
                res.append([lelse[0]+point, lelse[1]+i])
                if point >= g:
                    break
    return(res)

results = min_plobrem(p,c)
for result in results:
    if result[0] >= g:
        minp = min(minp, result[1])

print(minp)

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
  pritn("ABC")
  
elif R < 2800:
  print("ARC")
  
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
def resolve():
	d, g = map(int, input().split())
	ps = []
	cs = []
	ans = 100**6
	for _ in range(d):
		p, c = map(int, input().split())
		ps.append(p)
		cs.append(c)
	for i in range(d-1, -1, -1):
		total = 0
		solved = 0
		for _ in range(ps[i]):
			if total >= g:
				if ans > solved:
					ans = solved
				break
			total += 100 * (i + 1)
			solved += 1
		total += cs[i]
		if total >= g and ans > solved:
			ans = solved
			break
		for j in range(d-1, -1, -1):
			if i == j:
				continue
			for _ in range(ps[j]):
				if total >= g:
					if ans > solved:
						ans = solved
					continue
				total += 100 * (j+1)
				solved += 1
			total += cs[j]
	print(ans)
resolve()

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
    print('ABC')
elif 1200 <= R < 2800
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    print("ABC")
elif: R < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:

r = int(input())

if r < 1200:
    print("ABC")
elif r 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
D,G=map(int,input().split())
 
pc=[list(map(int,input().split())) for i in range(D)]
 
ans=float('inf')
 
for i in range(1<<D):
    s=0
    c=0
    for k in range(D):
        if 1&i>>k:
            s+=(k+1)*100*pc[k][0]+pc[k][1]
            c+=pc[k][0]
 
    if s>=G:
        ans=min(ans,c)
 
    if s<G:
        for k in reversed(range(D)):
            if not(1&i>>k):
                ac=-(-(G-s)//((k+1)*100))
                if  pc[k][0]>ac:
                    ans=min(ans,c+ac)
                    break
print(ans)

Submission status: Runtime Error

Solution code:
d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]

ans = float("inf")


for bit in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1,d+1))

    for i in range(d):
        if bit & (1<<i):
            sum +=pc[i][0]*(i+1)*100+pc[i][1]
            count +=pc[i][0]
            nokori.discard(i+1)



    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0],(g-sum)//(use*100))
        count += n
        sum += n*use *100

    if sum >= g:
        ans = min(ans,count)
print(ans)

Submission status: Runtime Error

Solution code:
d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]

ans = float("inf")


for bit in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1,d+1))

    for i in range(d):
        if bit & (1<<i):
            sum +=pc[i][0]*(i+1)*100+pc[i][1]
            count +=pc[i][0]
            nokori.discard(i+1)



    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0],-(-(g-sum)//(use*100)))
        count += n
        sum += n*use *100

    if sum >= g:
        ans = min(ans,count)
print(ans)

Submission status: Runtime Error

Solution code:
D,G = map(int,input().split())
P=[]
C=[]
for _ in range(D):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)
anss=2**10
for i in range(1 << D):
    ans = 0
    summ = 0
    nokori = set(range(1,D+1))
    for j in range(D):
        if 1 & (i >> j):
            summ += P[j]*100*(j+1)+C[j]
            ans += P[j]
            nokori.discard(j+1)
    if summ < G:
        use = max(nokori)
        n = min(P[use-1],-((G-summ)//(100*use)))
        ans += n
        summ += n* use* 100

    if summ < G:
        summ+=C[use-1]

    if summ >= G:
        anss =min(ans,anss)
        
print(anss

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    # 入力取得
    d, g = map(int, input().split())
 
    p = [0]*d
    c = [0]*d
    for i in range(d):
        p[i], c[i] = map(int, input().split())
 
    result = 99999999
 
    # 処理
    # ビット全探索(0:一問も解かない、1:全問解く)
    for i in range(1 << d):
 
        now_answer_count = 0
        now_point = 0
 
        # まず、全問解く問題を解いた場合の回答数と点数を取得。
        for j in range(d):
            # 全問解く場合
            # 数値 × 文字列 のパターンじゃない場合、判定条件は「i & 1 << j」でＯＫ。
            # この場合は数値 × list。
            if i & 1 << j:
                # 加算する
                # 回答数を加算
                now_answer_count += p[j]
                # 点数を加算
                now_point += p[j] * (j+1) * 100
                # コンプリートポイントを加算
                now_point += c[j]
 
        # print("--全問回答完了時--")
        # print(bin(i))
        # print("回答数:" + str(now_answer_count))
        # print("点数:" + str(now_point))
 
        # 次に、途中まで回答する問題を回答した場合の検証。
        j = 0
        for j in range(d):
 
            # print("--一部回答シュミレーション--" + str(j))
            # 全問解く場合(何もしない)
            if i & 1 << j:
                pass
            # 一問も解かない場合
            # Ｘ問回答したらどうなるか？をシュミレーションする。
            else:
                for k in range(p[j] + 1):
                    # print("回答数:" + str(k))
                    # print("加算点数:" + str(100*(j+1)*k))
                    work_now_point = 100*(j+1)*k
 
                    # 点数が必要点に達した場合
                    if now_point + work_now_point >= g:
                        # print("点数が足りた:")
                        # print("点数が足りた:回答数：" + str(now_answer_count + k))
                        # 回答数を更新する。
                        result = min(result, now_answer_count + k)
 
    print(result)

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
    print("ABC"):
elif 1200 <= R and R < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
K=int(input());print('ABC'(K<1200)or'ARC'(K<2800)or'AGC')

Submission status: Runtime Error

Solution code:
Vx = int(input())

if x < 1200:
  print("ABC")
elif x < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
r = input()
if r < 1200:
  print('ABC')
elif r >= 2800:
  print("AGC")
else:
  print('ARC')

Submission status: Runtime Error

Solution code:
R=int(input())

if 1200>R:
  print('ABC')
else if 2800>R:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
R=int(input())
if 1200>R:
  print('ABC')
else if 2800>R:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
R=int(input())

if 4208>=R>=2800:
  print('AGC')
else if 1200>R:
  print('ABC')
else:
  print('ARC')

Submission status: Runtime Error

Solution code:
r = int(input())
ans = "AGC"
if r < 1200:
    ans = "ABC"
else r < 2800:
    ans = "ARC"
print(ans)

Submission status: Runtime Error

Solution code:
r = int(input())
r = "AGC"
if r < 1200:
    ans = "ABC"
else r < 2800:
    ans = "ARC"
print(ans)

Submission status: Runtime Error

Solution code:
d,g = map(int,input().split())
p = [0] * d
c = [0] * d
for i in range(d):
    p[i],c[i] = map(int,input().split())
#
s = [0] * (2**d)
n = [0] * (2**d)
m =[]
for j in range(2**d):
    for k in range(d):
        if 1 & (j>>k):
            s[j] += 100*(d - k)*p[d - k - 1] + c[d - k - 1]
            n[j] += p[d - k - 1]
    for l in range(p[(str(format(j,'b').zfill(d))).rfind('0')]):
        if s[j] < g:
            s[j] += 100 * ((str(format(j,'b').zfill(d))).rfind('0') + 1)
            n[j] += 1
        else:
            break
    if s[j] >= g:
        m.append(n[j])


#
ans = min(m)
print(ans)

Submission status: Runtime Error

Solution code:
r = map(int,input().split())
if r <= 1999:
    print("ABC")
elif r <= 2799:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
S = input()
flag = 0
flag_of_flag = 0
now = 0
komoji = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if S[0] == "A":
  flag += 1
for i in range(2,len(S)-1):
  if S[i] == "C":
    now += 1
  elif S[i] in k:
    komoji += 1
if now == 1:
  flag += 1
if S[1] in k and S[len(S)-2] in k and S[len(S)-1] in k:
  komoji += 3
if flag == 2:
  if komoji == len(S)-2:
    print("AC")
  else:
    print("WA")
else:
  print("WA")

Submission status: Runtime Error

Solution code:
r=int(input())
if r < 1200:
  print("ABC")
elif r < 2800:
  print("ARC")
else:
  orint("AGC")

Submission status: Runtime Error

Solution code:
D,G=map(int,input().split())

p=[0]*D
c=[0]*D

for i in range(D):
    p[i],c[i]=map(int,input().split())
ans=10e+9

for i in range(2**D):
    sum=0
    q=0
    for j in range(D):
        if(i>>j & 1):
            sum+=(j+1)*100*p[j]+c[j]
            q+=p[j]
        else:
            rest_max=j
    if(sum<G):
        r1=100*(rest_max+1)
        need=-(-(G-sum)//r1)
        if(need>=p[rest_max]-1):
            continue
        q+=need
        sum+=need*r1
    
    if(sum>=G):
        ans=min(ans,q)

print(ans)

Submission status: Runtime Error

Solution code:
r=int(input())
if r<1200:
    print('ABC')
elif　r<2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
r=int(input())
if r<1200:
  print('ABC')
elif　r<2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
d, g = map(int,input().split())
plist = [list(map(int,input().split())) for i in range(d)]

basiclist = []

problem = []

for i in range(len(plist)):
    tmplist = [plist[i][0], (plist[i][0])*(i+1)*100+plist[i][1]]
    problem.append(plist[i][0])
    basiclist.append(tmplist)

# print(basiclist)

import itertools

combs = []

for i in range(1, len(problem)+1):
    els = [list(x) for x in itertools.combinations(problem, i)]
    combs.extend(els)

# print(combs)

mincount = 2**10+1

for k in range (1, basiclist[-1][0]):
    if k*len(basiclist)*100 >= g:
        print(k)
        exit(0)

for comb in combs:
    remaininglist=[]
    for basic in basiclist:
        if basic[0] not in comb:
            remaininglist.append(basic[0])
    best_remaining_score = len(remaininglist)*100
    total_ps = 0
    for com in comb:
        tmp = 0
        for basic in basiclist:
            if com == basic[0]:
                if basic[1] > tmp:
                    tmp = basic[1]
        total_ps += tmp
    # print(total_ps)
    if len(remaininglist) == 0:
        mincount = min(mincount, sum(comb))
        continue
    for i in range(remaininglist[-1]):
        if total_ps + best_remaining_score*i >= g:
            mincount = min(mincount, i + sum(comb))
            break

print(mincount)

Submission status: Runtime Error

Solution code:
r=int(input())
if r<1200:
  print('ABC')
elif　1200<=r<2800:
  print('ARC')
else:
  print('AGC')

Submission status: Runtime Error

Solution code:
D, G = map(int, input().split())
p = [0] * D
c = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())


# リスト生成
# [[0, 1, 2, 3], [0, 1, 2, 3, 4, 5]]
lis = [[] for i in range(len(p))]
# print(lis)
for i in range(len(p)):
    for j in range(p[i]+1):
        lis[i].append(j)
# print(lis)

# -------------------------------------------------------------------------
# https://youkoso-guest.hatenadiary.org/entry/20081212/1229089595
# 直積作成
from functools import reduce

# 直積を求める関数
def product(lists):
    return reduce(
        lambda prod, list: [x + [y] for x in prod for y in list],
        lists, [[]])
# -------------------------------------------------------------------------

chokuseki = product(lis)
# print(chokuseki)

def keisan(lis):
#     global p, c, D, G
    goukei = 0
    for i in range(D):
        goukei += (i+1) * 100 * lis[i]
        if lis[i] == p[i]:
            goukei += c[i]
#         print(goukei)
    
    if goukei >= G:
        return(sum(lis))

scores = []
for x in chokuseki:
    if keisan(x) != None:
        scores.append(keisan(x))

print(min(scores))

Submission status: Runtime Error

Solution code:
if x<1200:
    print("ABC")
elif 1200<=x and x<2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
num = int(input())
if (num < 1200):
  print("ABC")
elif (num < 2800):
  print("ARC")
else
  print("AGC")

Submission status: Runtime Error

Solution code:
n = int(input())
if n < 1199:
  print("ABC")
elif n < 2800:
  print("ARC")
else:
  print("AGC)

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
    print("ABC")
eif R < 2800:
    print("ARC")
else:
    print("AGC")

Submission status: Runtime Error

Solution code:
n = input()
if n < 1200: print('ABC')
elif n < 2800: print('ARC')
else: print('AGC')

Submission status: Runtime Error

Solution code:
def main():
    from sys import stdin, setrecursionlimit
    setrecursionlimit(10**6)
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    r = int(r)
    if r < 1200:
        print('ABC')
    elif r < 2800
        print('ARC')
    else:
        print('AGC')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
R = int(input())
 
if R < 1200:
  r = 'ABC'
elif R < 2800:
  r = 'ARC':
else:
  r ='AGC'
print(r)

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
  r = 'ABC'
elif R < 2800:
  r = 'ARC':
else:
  r ='AGC'

print(r)

Submission status: Runtime Error

Solution code:
import math
D, G = map(int, input().split())

PC = []
for _ in range(D):
    p, c = map(int, input().split())
    PC.append([p, c])

ans = 10 ** 9

#全部解く・解かないが2のD乗通りになる
for i in range(2 ** D):
    score = 0
    time = 0
    maxj = -1
    #全部解く場合
    for j in range(D):
    #jケタ落としていき、末尾 == 1であれば、つまりj番目の問題セットを全部解いていれば
        if ((i >> j) & 1):
            score += (j + 1) * PC[j][0] * 100 + PC[j][1]
            time += PC[j][0]
        #全てを解かなかった問題セットのうち最も大きいj
        ##全て解かない問題セットは1つでよく、最大の素点のもの=一番大きいjでよい
        else:
            maxj = max(maxj,j)
    #全てを全部解いた場合
    if maxj == -1:
        if score >= G:
            ans = min(ans, time)
    #jケタめを全て使わずにG以上のスコアとなった場合
    elif score + (maxj + 1) * (PC[maxj][0] - 1) * 100 >= G:
        #必要な最小問題数を小数点切り上げで求める
        ##残りが500点であったとき、300点問題なら2問、200点問題なら3問解けばよい
        time += max(0, math.ceil((G - score) / (maxj + 1) / 100))
        #最小のものを更新していく
        ans = min(ans, time)

print(ans)

Submission status: Runtime Error

Solution code:
import sys

r = map(int, sys.stdin.readline().rstrip())

def main():
    if r < 1200:
        return 'ABC'
    elif r < 2800:
        return 'ARC'
    else:
        return 'AGC'

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Runtime Error

Solution code:
import math

D, G = [int(x) for x in input().split()]
P = [[int(x) for x in input().split()] for i in range(D)]

min_ = 1e+8
for bit in range(2**D):
  score = 0
  n_solved = 0
  rest = -1
  for i in range(D):
    if bit >> i & 1: 
      score += (i + 1) * 100 * P[i][0] + P[i][1]
      n_solved += P[i][0]
    else:
      rest = i
  if G > score:
    s1 = 100 * (rest + 1)
    need = (G - score + s1 - 1) // s1
    if need >= P[rest][0]:
      continue
    n_solved += need
  min_ = min(min_, n_solved)
print(min_)

Submission status: Runtime Error

Solution code:
import math

D, G = [int(x) for x in input().split()]
P = [[int(x) for x in input().split()] for i in range(D)]

min_ = 1e+8
for bit in range(2**D):
  score = 0
  n_solved = 0
  rest = -1
  for i in range(D):
    if bit & (1 << i): 
      score += (i + 1) * 100 * P[i][0] + P[i][1]
      n_solved += P[i][0]
    else:
      rest = i
  if G > score:
    s1 = 100 * (rest + 1)
    need = (G - score + s1 - 1) // s1
    if need > P[rest][0]:
      continue
    n_solved += need
  min_ = min(min_, n_solved)
print(min_)

Submission status: Runtime Error

Solution code:
def dfs(i, total, S, remain):
    global ans
    if i == D:
        if S < G:
           use = max(remain)
           N = min(L[use-1][0], (G-S)//(100*use))
           S += 100 * N * use
           total += N
           
        if S >= G:
           ans = min(ans, total)
    else:
        dfs(i+1, total, S, remain)
        dfs(i+1, total + L[i][0], S + 100 * (i+1) * L[i][0] + L[i][1], remain - {i+1})
 
D, G = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(D)]
ans = 10 ** 9
 
dfs(0, 0, 0, set(range(1, D+1)))
 
print(ans)

Submission status: Runtime Error

Solution code:
def rate(n):
    if n < 1200:
        print('ABC')
    elif 1200 <= n <2800:
        print('ARC')
    else:
        print('AGC')

rate(input())

Submission status: Runtime Error

Solution code:
D,G = map(int,input().split())
X = [list(map(int,input().split())) for _ in range(D)]

ans = 0

for i in range(2**D):
    point = 0
    count = 0

    for j in range(D):
        if(i>>j)&1: # コンプリート
            point += X[j][0]*(j+1)*100 + X[j][1]
            count += X[j][0]
    
    if G > point:
        for k in range(D-1,-1,-1):
            if(i>>k)&1 == 0:
                if (G - point) <= X[k][0]*(k+1)*100:
                    count += (G - point - 1) // ((k+1)*100)  + 1
                    break
                else:
                    count = 10**5 # とりあえず大きい数
                    break
    
    if ans == 0 or count < ans:
        ans = count

print(ans)

Submission status: Runtime Error

Solution code:
N3 = int(input())
if N3 < 1200:
    print('ABC')
elif N3 > 1999 and N3 < 2800:
    print('ARC')
elif NR > 2799:
    print('AGC')

Submission status: Runtime Error

Solution code:
N3 = int(input())
if N3 < 1200:
    print('ABC')
elif N3 > 1999 and NR < 2800:
    print('ARC')
else:
    print('AGC')

Submission status: Runtime Error

Solution code:
if A[0] == "A" and  big == 2 and CNUM == 1 and A[-1] != "C":  
    print("AC")
else:
    print("WA")

Submission status: Runtime Error

Solution code:
n=int(input())
if(n<1200):
  print("ABC")
elif(n<2800):
  print("ARC"):
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
n=int(input())
if(n<1200):
  print("ABC")
elif(n<2800):
  print("ARC"):
elif(n>=2800):
  print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
    print("ABC")
elif 1200 < R < 2800:
    print("ARC")
elif 2800 < R
    print("AGC")

Submission status: Runtime Error

Solution code:
R =int(input())

if R < 1200:
    print("ABC")
elif 1200 < R < 2800:
    print("ARC")
elif 2800 < R
    print("AGC")

Submission status: Runtime Error

Solution code:
r = int(input());print("ABC"if r<1200else"ARC"if else r<2800else"AGC")

Submission status: Runtime Error

Solution code:
inp = int(input())

if inp < 1200:
  print("ABC")
else if 1200 <= inp && inp < 2800:
  print("ARC")
else:
  print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())

if R < 1200:
    print('ABC')
elif R < 2800:
    print('ARC')
else
    print('AGC')

Submission status: Runtime Error

Solution code:
n=int(nput())
print('ABC' if n < 1200 else 'ARC' if 1200 <= n < 2800 else 'AGC')

Submission status: Runtime Error

Solution code:
n=input()
print('ABC' if n < 1200 else 'ARC' if 1200 <= n < 2800 else 'AGC')

Submission status: Runtime Error

Solution code:
import sys
s=list(input())
if s[0]!='A':
    break
count=0
for i in range(2,len(s)-2):
    if s[i]=='C':
        count+=1

if count==1:
    s.remove('A')
    s.remove('C')    
    res=''.join(s)
    print('AC' if res.islower()==True else 'WA') #str.islower():全部小文字ならTrue

else:
    print('WA')

Submission status: Runtime Error

Solution code:
"""
https://atcoder.jp/contests/abc104/tasks/abc104_c
"""
D,G=map(int,input().split())
l = [list(map(int, input().split()))  for _ in range(D)]

minP = 10 ** 100
for i in range(2**D):
  point, tmpP = 0,0
  for j in range(D):
    if (i>>j)&1:
      point += 100*l[j][0]*(j+1) + l[j][1]
      tmpP += l[j][0]
  if point>=G:
    minP = min(minP, tmpP)
  else:
    for j in range(D-1,-1,-1):
      if (i>>j)&1:
        continue
      else:
        for _ in range(l[j][0]):
          point += (j+1)*100
          tmpP += 1
          if point>=G:
            break
      if point >= G:
        break
  minP = min(minP, tmpP)
print(minP)

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
  print("ABC")
else:
    if R < 2800:
      print("ARC")
  else:
      print("AGC")

Submission status: Runtime Error

Solution code:
R = int(input())
if R < 1200:
  print("ABC")
else:
    if R < 2800:
    print("ARC")
  else:
    print("AGC")

Submission status: Runtime Error

Solution code:
n=int(input())
if n < 1200:
    print("ABC")
    elif n<2800:
    print("ARC")
   else:print("AGC")

Submission status: Runtime Error

Solution code:
n=input()
if n <1200
print("ABC")
elif n<2800
print("ARC")
lese
print("AGC")