Problem:


Score: 100 points

Problem Statement

M-kun is a competitor in AtCoder, whose highest rating is X.

In this site, a competitor is given a kyu (class) according to his/her highest rating. For ratings from 400 through 1999, the following kyus are given:

From 400 through 599: 8-kyu

From 600 through 799: 7-kyu

From 800 through 999: 6-kyu

From 1000 through 1199: 5-kyu

From 1200 through 1399: 4-kyu

From 1400 through 1599: 3-kyu

From 1600 through 1799: 2-kyu

From 1800 through 1999: 1-kyu

What kyu does M-kun have?

Constraints

400 \leq X \leq 1999

X is an integer.

Input

Input is given from Standard Input in the following format:

X

Output

Print the kyu M-kun has, as an integer.
For example, if he has 8-kyu, print 8.

Sample Input 1

725

Sample Output 1

7

M-kun's highest rating is 725, which corresponds to 7-kyu.

Thus, 7 is the correct output.

Sample Input 2

1600

Sample Output 2

2

M-kun's highest rating is 1600, which corresponds to 2-kyu.

Thus, 2 is the correct output.



Sample input:
725


Sample output:
7

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define sz(v)   ((int)(v).size())
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define    clr(v,d)      memset( v, d ,sizeof(v))
#define     PI                       acos(-1)
typedef  long long     ll ;
typedef  unsigned long long ull;
const double eps= (1e-9);
using namespace std;
int dcmp(long double a,long double b){   return fabsl(a-b)<=eps ? 0: (a>b)? 1:-1  ;}
int getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1;}
int setBit1(int num, int idx) {return num | (1<<idx);}
ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}
void GO(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
int countNumBit1(int mask) {int ret=0; while (mask) 	{mask &= (mask-1);++ret;	}return ret;}
const int N=1000000+9;
int solve(int x){

   if(x>=400&&x<=599) return 8;
   if(x>=600&&x<=799) return 7;
   if(x>=800&&x<=999) return 6;
   if(x>=1000&&x<=1199) return 5;
   if(x>=1200&&x<=1399) return 4;
   if(x>=1400&&x<=1599) return 3;
   if(x>=1600&&x<=1799) return 2;
   if(x>=1800&&x<=1999) return 1;

}
int main(){
    GO();
    int T;
   // cin>>T;
   T=1;
    while(T--){

        int x;
        cin>>x;
        cout<<solve(x)<<"\n";





    }

}

Submission status: Runtime Error

Solution code:
N = int(input())
X = [None] * N
Y = [None] * N
U = [None] * N
for i in range(N):
  X[i], Y[i], U[i] = input().split()

def main():
  for i in range(N):
    for j in range(N):
      if (i > j):
        continue

      if (U[i] == U[j]):
        continue

      if (U[i] == 'U' and U[j] == 'R'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(Y[i])):
          return(abs((int(Y[j]) - int(Y[i]))*10))

      if (U[i] == 'U' and U[j] == 'D'):
        if (int(X[i]) == int(X[j])) and (int(Y[i]) < int(Y[j])) and (int(Y[i]) - int(Y[j])) % 2 == 0:
          return(abs((int(Y[i]) - int(Y[j]))*5))

      if (U[i] == 'U' and U[j] == 'L'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'R' and U[j] == 'U'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          return(abs((int(X[j]) - int(X[i]))*10))

      if (U[i] == 'R' and U[j] == 'D'):
        if (int(X[j]) > int(X[i]) and int(X[j]) - int(X[i]) == int(Y[j]) - int(Y[i])):
          return(abs((int(X[j]) - int(X[i]))*10))

      if (U[i] == 'R' and U[j] == 'L'):
        if (int(Y[i]) == int(Y[j])) and (int(X[i]) < int(X[j])) and (int(X[i]) - int(X[j])) % 2 == 0:
          return(abs((int(X[i]) - int(X[j]))*5))

      if (U[i] == 'D' and U[j] == 'U'):
        if (int(X[i]) == int(X[j])) and (int(Y[i]) > int(Y[j])) and (int(Y[i]) - int(Y[j])) % 2 == 0:
          return(abs((int(Y[i]) - int(Y[j]))*5))

      if (U[i] == 'D' and U[j] == 'R'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[i]) - int(X[j])):
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'D' and U[j] == 'L'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'L' and U[j] == 'U'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[i]) - int(Y[j])):
          return(abs((int(X[i]) - int(X[j]))*10))
      
      if (U[i] == 'L' and U[j] == 'D'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(Y[i])):
          return(abs((int(X[i]) - int(X[j]))*10))

      if (U[i] == 'L' and U[j] == 'R'):
        if (int(Y[i]) == int(Y[j])) and (int(X[i]) > int(X[j])) and (int(X[j]) - int(X[i])) % 2 == 0:
          return(abs((int(X[j]) - int(X[i]))*5))

  return('SAFE')

print(main())

Submission status: Runtime Error

Solution code:
N = int(input())
X = [None] * N
Y = [None] * N
U = [None] * N
for i in range(N):
  X[i], Y[i], U[i] = input().split()

def main():
  for i in range(N):
    for j in range(N):
      if (i > j):
        continue

      if (U[i] == U[j]):
        continue

      '''
      U vs R ... Ux > Rx and Ux - Rx == Ry - Uy
      U vs D ... Ux == Dx and Uy < Dy and (Uy - Dy) % 2 == 0 # Note: if Uy = 3, Dy = 0, conflict does NOT happen
      U vs L ... Uy > Ly and Uy - Ly == Lx - Ux
      '''
      if (U[i] == 'U' and U[j] == 'R'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(Y[i])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(Y[j]) - int(Y[i]))*10))

      if (U[i] == 'U' and U[j] == 'D'):
        if (int(X[i]) == int(X[j])) and (int(Y[i]) < int(Y[j])) and (int(Y[i]) - int(Y[j])) % 2 == 0:
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(Y[i]) - int(Y[j]))*5))

      if (U[i] == 'U' and U[j] == 'L'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(Y[i]) - int(Y[j]))*10))

      '''
      R vs U ... Ry > Uy and Ry - Uy == Ux - Rx
      R vs D ... Dx > Rx and Dx - Rx == Dy - Ry
      R vs L ... Ry == Ly and Rx < Lx and (Rx - Lx) % 2 == 0
      '''
      if (U[i] == 'R' and U[j] == 'U'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(X[j]) - int(X[i]))*10))

      if (U[i] == 'R' and U[j] == 'D'):
        if (int(X[j]) > int(X[i]) and int(X[j]) - int(X[i]) == int(Y[j]) - int(Y[i])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(X[j]) - int(X[i]))*10))

      if (U[i] == 'R' and U[j] == 'L'):
        if (int(Y[i]) == int(Y[j])) and (int(X[i]) < int(X[j])) and (int(X[i]) - int(X[j])) % 2 == 0:
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(X[i]) - int(X[j]))*5))

      '''
      D vs U ... Dx == Ux and Dy > Uy and (Dy - Uy) % 2 == 0
      D vs R ... Dy > Ry and Dy - Ry == Dx - Rx
      D vs L ... Dy > Ly and Dy - Ly == Lx - Dx
      '''
      if (U[i] == 'D' and U[j] == 'U'):
        if (int(X[i]) == int(X[j])) and (int(Y[i]) > int(Y[j])) and (int(Y[i]) - int(Y[j])) % 2 == 0:
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(Y[i]) - int(Y[j]))*5))

      if (U[i] == 'D' and U[j] == 'R'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[i]) - int(X[j])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'D' and U[j] == 'L'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(Y[i]) - int(Y[j]))*10))

      '''
      L vs U ... Lx > Ux and Lx - Ux == Ly - Uy
      L vs D ... Lx > Dx and Lx - Dx == Dy - Ly
      L vs R ... Ly == Ry and Lx > Rx and (Rx - Lx) % 2 == 0
      '''
      if (U[i] == 'L' and U[j] == 'U'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[i]) - int(Y[j])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(X[i]) - int(X[j]))*10))
      
      if (U[i] == 'L' and U[j] == 'D'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(Y[i])):
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(X[i]) - int(X[j]))*10))

      if (U[i] == 'L' and U[j] == 'R'):
        if (int(Y[i]) == int(Y[j])) and (int(X[i]) > int(X[j])) and (int(X[j]) - int(X[i])) % 2 == 0:
          #print('{} {}'.format(U[i], U[j]))
          return(abs((int(X[j]) - int(X[i]))*5))

  return('SAFE')

print(main())

Submission status: Runtime Error

Solution code:

#include <bits/stdc++.h>
#define LL               long long
#define PB               push_back
using namespace std;
int main (){
  int n; cin>>n;
  if (n<600) cout<< 8 ;
  else if (n<800) cout<<7  ;
  else if (n<1000) cout<<6  ;
  else if (n<1200) cout<< 5 ;
  else if (n<1400) cout<< 4 ;
  else if (n<1600) cout<< 3;
  else if (n<1800) cout<<2  ;
  else cout<< 1 ;
}

Submission status: Runtime Error

Solution code:
X = int(input())
 
Ratintg = 10 - (X // 20)
 
print(Rating)

Submission status: Runtime Error

Solution code:
X = int(input())
 
Ratintg = 10 - X // 20
 
print(Rating)

Submission status: Runtime Error

Solution code:
X = int(split())

Ratintg = 10 - X // 20

print(Rating)

Submission status: Runtime Error

Solution code:
X = int(split())
 
Rating = 10 - (X // 200)
 
print(Rating + "級")

Submission status: Runtime Error

Solution code:
print(10-int(input)//200)

Submission status: Runtime Error

Solution code:
X = int(split())

q = X // 200
Rating = 10-q

print(Rating + "級")

Submission status: Runtime Error

Solution code:
def ranking(x):
    if(x>=400):
        if(x<600):
            return 8
        elif(x<800):
            return 7
        elif (x < 1000):
            return 6
        elif (x < 1200):
            return 5
        elif (x < 1400):
            return 4
        elif (x < 1600):
            return 3
        elif (x < 1800):
            return 2
        elif (x < 2000):
            return 1
x=input()
print(ranking(x))

Submission status: Runtime Error

Solution code:
def ranking(x):
    if(x>=400):
        if(x<600):
            return 8
        elif(x<800):
            return 7
        elif (x < 1000):
            return 6
        elif (x < 1200):
            return 5
        elif (x < 1400):
            return 4
        elif (x < 1600):
            return 3
        elif (x < 1800):
            return 2
        elif (x < 2000):
            return 1
x=input()
ranking(x)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

Stock = 0
Money = 1000
 
for i in range(N-1):
    if A[i] < A[i + 1]:

        Stock = Money // A[i]
        Money %= A[i]
        Money += Stock * A[i+1]
print(Money)

Submission status: Runtime Error

Solution code:
num = int(input())
 
if(400<=num and num<=599)
	print('8')
elif(600<=num and num<=799)
	print('7')
elif(800<=num and num<=999)
	print('6')
elif(1000<=num and num<=1199)
	print('5')
elif(1200<=num and num<=1399)
	print('4')
elif(1400<=num and num<=1599)
	print('3')
elif(1600<=num and num<=1799)
	print('2')
elif(1800<=num and num<=1999)
	print('1')

Submission status: Runtime Error

Solution code:
num = input()

if(400<=num and num<=599)
	print('8')
elif(600<=num and num<=799)
	print('7')
elif(800<=num and num<=999)
	print('6')
elif(1000<=num and num<=1199)
	print('5')
elif(1200<=num and num<=1399)
	print('4')
elif(1400<=num and num<=1599)
	print('3')
elif(1600<=num and num<=1799)
	print('2')
elif(1800<=num and num<=1999)
	print('1')

Submission status: Runtime Error

Solution code:
import sys
read = sys.stdin.readline
import time
import math
import itertools as it
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N, K = inpl()
A = inpl()
for i in range(K, N):
    if A[i] > A[i-K]:
        print('Yes')
    else:
        print('No')

# -----------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Submission status: Runtime Error

Solution code:
n = int(input())

a = 8 - ( (n -400) // 200)

print a

Submission status: Runtime Error

Solution code:
print(8 - (X // 200 - 2))

Submission status: Runtime Error

Solution code:
X = int(input())
print 10 - X//200

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
A=list(map(int,input().split()))
hyoutei=[0]*(N+1)
for i in range(K,N):#K+1-N
    if A[i]/A[i-K]>1:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
X=int(input())
if X<599:
    k=8
elif 600<=X<799:
    k=7
elif 800<=X<999:
    k=6
elif 1000<=X<1199:
    k=5
elif 1200<=X<1399:
    k=4
elif 1400<=X<1599:
    k=3
elif 1600<=X<1799:
    k=2
elif 1800<=X:
    k=1

print(k)

Submission status: Runtime Error

Solution code:
x = int(input())
 
if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    prnit(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
elif 1800 <= x <= 1999:
    print(1)

Submission status: Runtime Error

Solution code:
x=int(input())
 
if 400 <= x <= 599:
    print(8)
elif 600 <= x <= 799:
    print(7)
elif 800 <= x <= 999:
    prnit(6)
elif 1000 <= x <= 1199:
    print(5)
elif 1200 <= x <= 1399:
    print(4)
elif 1400 <= x <= 1599:
    print(3)
elif 1600 <= x <= 1799:
    print(2)
elif 1800 <= x <= 1999:
    print(1)

Submission status: Runtime Error

Solution code:
X=int(input())
 
if 400 <= X <= 599:
    print(8)
elif 600 <= X <= 799:
    print(7)
elif 800 <= X <= 999:
    prnit(6)
elif 1000 <= X <= 1199:
    print(5)
elif 1200 <= X <= 1399:
    print(4)
elif 1400 <= X <= 1599:
    print(3)
elif 1600 <= X <= 1799:
    print(2)
elif 1800 <= X <= 1999:
    print(1)

Submission status: Runtime Error

Solution code:
X=int(input())
 
if 400<=X<=599:
    print(8)
elif 600<=X<=799:
    print(7)
elif 800<=X<=999:
    prnit(6)
elif 1000<=X<=1199:
    print(5)
elif 1200<=X<=1399:
    print(4)
elif 1400<=X<=1599:
    print(3)
elif 1600<=X<=1799:
    print(2)
elif 1800<=X<=1999:
    print(1)

Submission status: Runtime Error

Solution code:
def main():
    a, b, c = map(int, input().split())
    k = int(input())

    op = 0
    while not (a < b and b < c):
        if not a < b:
            b *= 2
            op += 1
        elif not b < c:
            c *= 2
            op += 1

    if op <= k:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def laod_to_mill():
    days = int(input())
    prices = tuple(map(int, input().split()))

    if max(prices) == prices[0]:
        print(1000)
        return

    total = 1000
    ks = 0

    for d in range(days):
        if d == days - 1:
            total += ks * prices[d]
            break

        if prices[d] < prices[d + 1]:
            buy = total // prices[d]
            total -= buy * prices[d]
            ks += buy

        elif prices[d] > prices[d + 1]:
            total += ks * prices[d]
            ks = 0

    print(total)


def main():
    laod_to_mill()


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
X=int(input())

if 400 <= x <= 599:
  print(8)
elif 600 <= x <= 799:
  print(7)
elif 800 <= x <= 999:
  print(6)
elif 1000 <= x <= 1199:
  print(5)
elif 1200 <= x <= 1399:
  print(4)
elif 1400 <= x <= 1599:
  print(3)
elif 1600 <= x <= 1799:
  print(2)
elif 1800 <= x <= 1999:
  print(1)

Submission status: Runtime Error

Solution code:
#! /usr/bin/env python3

import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(readline())
XYP = [list(map(int, readline().split())) for _ in range(N)]

x_cost = [0] * ((1 << N) * N)
y_cost = [0] * ((1 << N) * N)

for bit in range(1 << N):
    for i, (xi, yi, _) in enumerate(XYP):
        x_cost[bit * N + i] = abs(xi)
        y_cost[bit * N + i] = abs(yi)

        for k, (xk, yk, _) in enumerate(XYP):
            if bit & (1 << k):
                x_cost[bit * N + i] = min(x_cost[bit * N + i], abs(xi - xk))
                y_cost[bit * N + i] = min(y_cost[bit * N + i], abs(yi - yk))

ans = [sys.maxsize for _ in range(N + 1)]

for bit in range(1 << N):
    cnt = bin(bit).count('1')
    bit_ = bit
    while bit_ >= 0:
        bit_ &= bit
        cost = 0
        for k in range(N):
            cost += 1 * XYP[k][2] * min(x_cost[bit_ * N + k],
                                        y_cost[(bit - bit_) * N + k])
        ans[cnt] = min(ans[cnt], cost)

        bit_ -= 1
for i in range(N + 1):
    print(ans[i])

Submission status: Runtime Error

Solution code:
x = int(readline())
y = x // 200
print(10 - y)

Submission status: Runtime Error

Solution code:
try:
	X= int(input())
  	if(X>=400 and X<=599):
    	print(8)
  	elif(X>599 and X<800):
    	print(7)
    elif(X>=800 and X<1000):
      	print(6)
    elif(X>=1000 and X<1200):
      	print(5)
    elif(X>=1200 and X<1400):
      	print(4)
    elif(X>=1400 and X<1600):
      	print(3)
    elif(X>=1600 and X<1800):
      	print(2)
    elif(X>=1800 and X<2000):
      	print(1)
except EOFError as e:
  print("")

Submission status: Runtime Error

Solution code:
# Fast IO (only use in integer input)

# import os,io
# input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline

from copy import copy

N = int(input())
Resident = []
for i in range(N):
    x,y,p = map(int,input().split())
    Resident.append((x,y,p))

minCost = [-1] * (N+1)

preCalRange = 1 << N

horizontalLineDistance = []
verticalLineDistance = []

for i in range(preCalRange):
    railRoad = []
    tmp = i
    for j in range(N):
        railRoad.append(tmp % 2)
        tmp //= 2
    minDistance = [-1] * N
    for j in range(N):
        minDistance[j] = min(abs(Resident[j][0]),abs(Resident[j][1]))
        for k in range(N):
            if railRoad[k] == 1 and abs(Resident[j][0] - Resident[k][0]) < minDistance[j]:
                minDistance[j] = abs(Resident[j][0] - Resident[k][0])
    horizontalLineDistance.append(copy(minDistance))
    minDistance = [-1] * N
    for j in range(N):
        minDistance[j] = min(abs(Resident[j][0]),abs(Resident[j][1]))
        for k in range(N):
            if railRoad[k] == 1 and abs(Resident[j][1] - Resident[k][1]) < minDistance[j]:
                minDistance[j] = abs(Resident[j][1] - Resident[k][1])
    verticalLineDistance.append(copy(minDistance))

totalCases = 3 ** N

for i in range(totalCases):
    railRoad = []
    tmp = i
    for j in range(N):
        railRoad.append(tmp % 3)
        tmp //= 3
    horizontalCount = 0
    verticalCount = 0
    numNewRailroad = 0
    for j in range(N):
        if railRoad[j] == 1:
            numNewRailroad += 1
            horizontalCount += 1 << j
        if railRoad[j] == 2:
            verticalCount += 1 << j
            numNewRailroad += 1
    minDistance = []
    for j in range(N):
        minDistance.append(min(horizontalLineDistance[horizontalCount][j], verticalLineDistance[verticalCount][j]))

    cost = 0
    for j in range(N):
        cost += Resident[j][2] * minDistance[j]
    if minCost[numNewRailroad] == -1 or minCost[numNewRailroad] > cost:
        minCost[numNewRailroad] = cost
for elem in minCost:
    print(elem)

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10**6)

N, K = map(int, input().split())

A = input("").split(" ")
A = [int(i) for i in A]


for i in range(1, N-K+1):
    score = 1
    p_score = 1

    for j in range(i, i+K):
        score = score * A[j]
        p_score = p_score * A[j-1]

    if score > p_score:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
a_cur = a[0]

m = 1000
s = 0

for i in range(1, n):
  a_next = a[i]
  if a_cur < a_next:
    # buy current and sell next
    s = m // a_cur
    m += s * (a_next - a_cur)
    a_cur = a_next
if s > 0:
  m += s * a[-1]
print(m)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())

A = input("").split(" ")
A = [int(i) for i in A]


for i in range(1, N-K+1):
    score = 1
    p_score = 1

    for j in range(i, i+K):
        score = score * A[j]
        p_score = p_score * A[j-1]

    if score > p_score:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
A = [list(input().split()) for i in range(n)]
l = 2*10**5 + 5
# l = 500
# B = [[int(A[i][0]), int(A[i][1]), int(A[i][0])+int(A[i][1]), int(A[i][0])-int(A[i][1])+l, A[i][2]] for i in range(n)]

D = [[[] for j in range(2*l)] for i in range(4)]

# for i in range(4):
#     for j in range(n):
#         D[i][B[j][i]].append(B[j])

for i in range(n):
    x = int(A[i][0])
    y = int(A[i][1])
    nn = [x,y,A[i][2]]
    D[0][x].append(nn)
    D[1][y].append(nn)
    D[2][x+y].append(nn)
    D[3][x-y+l].append(nn)

# print(D)
import bisect
ans = float("inf")
for i in range(l):
    # print(D[1][i])
    LR = [[], []]
    for j in range(len(D[1][i])):
        
        if D[1][i][j][2] == "L":
            LR[0].append(D[1][i][j][0])
        if D[1][i][j][2] == "R":
            LR[1].append(D[1][i][j][0])

        # print(j,LR)
        for k in range(len(LR[1])):
            ind = bisect.bisect(LR[0], LR[1][k])
            if ind != len(LR[0]):
                ans = min(ans, (LR[0][ind]-LR[1][k]) * 5)

for i in range(l):
    # print(D[0][i])
    LR = [[], []]
    for j in range(len(D[0][i])):
        
        if D[0][i][j][2] == "U":
            LR[0].append(D[0][i][j][1])
        if D[0][i][j][2] == "D":
            LR[1].append(D[0][i][j][1])

        # print(j,LR)
        for k in range(len(LR[0])):
            ind = bisect.bisect(LR[1], LR[0][k])
            # print("ind",ind)
            if ind != len(LR[1]):
                ans = min(ans, (LR[1][ind]-LR[0][k]) * 5)

for i in range(2*l):
    # print(D[1][i])
    LR = [[], []]
    LR2 = [[], []]
    for j in range(len(D[2][i])):
        
        if D[2][i][j][2] == "L":
            LR[0].append(D[2][i][j][0])
        if D[2][i][j][2] == "D":
            LR[1].append(D[2][i][j][0])

        if D[2][i][j][2] == "U":
            LR2[0].append(D[2][i][j][0])
        if D[2][i][j][2] == "R":
            LR2[1].append(D[2][i][j][0])

        # print(j,LR)
        for k in range(len(LR[1])):
            ind = bisect.bisect(LR[0], LR[1][k])
            if ind != len(LR[0]):
                ans = min(ans, (LR[0][ind]-LR[1][k]) * 10)
        
        for k in range(len(LR2[1])):
            ind = bisect.bisect(LR2[0], LR2[1][k])
            if ind != len(LR2[0]):
                ans = min(ans, (LR2[0][ind]-LR2[1][k]) * 10)

for i in range(2*l):
    # print(D[1][i])
    LR = [[], []]
    LR2 = [[], []]
    for j in range(len(D[3][i])):
        
        if D[3][i][j][2] == "D":
            LR[0].append(D[3][i][j][1])
        if D[3][i][j][2] == "R":
            LR[1].append(D[3][i][j][1])

        if D[3][i][j][2] == "L":
            LR2[0].append(D[3][i][j][1])
        if D[3][i][j][2] == "U":
            LR2[1].append(D[3][i][j][1])

        # print(j,LR)
        for k in range(len(LR[1])):
            ind = bisect.bisect(LR[0], LR[1][k])
            if ind != len(LR[0]):
                ans = min(ans, (LR[0][ind]-LR[1][k]) * 10)
        
        for k in range(len(LR2[1])):
            ind = bisect.bisect(LR2[0], LR2[1][k])
            if ind != len(LR2[0]):
                ans = min(ans, (LR2[0][ind]-LR2[1][k]) * 10)


if ans == float("inf"):
    ans = "SAFE"
print(ans)

Submission status: Runtime Error

Solution code:
def marks_C():
    N, K = map(int, input().split())
    scores = tuple(map(int, input().split()))

    for i, k in enumerate(range(K, N)):
     
        if calc_score(scores[i + 1:k + 1]) > calc_score(scores[i:k]):
            print('Yes')
        else:
            print('No')
     
     
def calc_score(score: tuple):
    total = 1
    for i in score:
        total *= i
     return total
     
     
if __name__ == '__main__':
    marks_C()

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        stock = money // A[i]
        money = money % A[i]
        money += stock * A[i+1]
print(money)

Submission status: Runtime Error

Solution code:
X = int(input())

lst = [ [400, 599, 8], [600, 799, 7], [800, 999, 6], [1000, 1199, 5], [1200, 1399, 4], [1400, 1599, 3], [1600, 1799, 2], [1800, 1999, 1] ]

def Kyu(X):
   
   for i in lst:
      if i[0] <= X <= i[1]:
         result = i[2]
         break
   
print(result)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
money = 1000
stock = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        stock = money // A[i]
        money = money % A[i]
        money = stock * A[i+1]
print(money)

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
A = list(map(int, input().split()))
B=[]
tot=1
for x in range(m):
    tot*=A[x]
temp=tot
for x in range(m,n):
    tot=tot//A[x-m]
    temp1=tot*A[x]
    if(temp1>temp):
        print("Yes")
    print("No")
    temp=temp1

Submission status: Runtime Error

Solution code:
x = int(input())
if 400 <= x <= 599: ans = 8
elif 600 <= x <= 799: ans = 7
elif 800 <= x <- 999: ans = 6
elif 1000 <= x <= 1199: ans = 5
elif 1200 <= x <= 1399: ans = 4
elif 1400 <= x <= 1599: ans = 3
elif 1600 <= x <= 1799: ans = 2
elif 1800 <= x <= 1999: ans = 1
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
 
if 400 < = x and x <= 599:
  print(8)
elif x <= 799:
  print(7)
elif x <= 999:
  print(6)
elif x <= 1199:
  print(5)
elif x <= 1399:
  print(4)
elif x <= 1599:
  print(3)
elif x <= 1799:
  print(2)
else:
  print(1)

Submission status: Runtime Error

Solution code:
n = int(input())

rate = 600
rank = 8

while true:
    if n < rate:
        print(rank)
        break
    rate += 200
    rank -= 1

Submission status: Runtime Error

Solution code:
n, k = (int(x) for x in input().split())
a = input().split()

for i in range(1,n-k+1):
    if(int(a[i-1]) >= int(a[k+i-1])):
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
n,k = input().split()
a = list(map(int,input().split()))
ten1 =0
ten2 =0
for x in range(int(n)-int(k)):
    ten1 = 0
    ten2 = 0
    for y in range(int(k)):
        ten1 += a[y+x]
        ten2 += a[y+1+x]
    if ten1 < ten2:
       print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
import itertools
from math import ceil

def main():
    n = int(input())
    ans = 10**9
    u = []
    r = []
    d = []
    l = []
    for _ in range(n):
        k = input().split()
        x,y = int(k[0]),int(k[1])
        if(k[2] == "U"):
            u.append((x,y))
        elif(k[2] == "R"):
            r.append((x,y))
        elif(k[2] == "D"):
            d.append((x,y))
        elif(k[2] == "L"):
            l.append((x,y))

    prd = list(itertools.product(l,r))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[1] == two[1] and one[0] > two[0]):
            dif = abs(one[0] - two[0])
            if(dif % 2 == 0):
                ans = min(ans,dif//2*10)
            
    prd = list(itertools.product(u,d))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[0] == two[0] and one[1] < two[1]):
            dif = abs(one[1] - two[1])
            if(dif % 2 == 0):
                ans = min(ans,dif//2 * 10)

    prd = list(itertools.product(u,r))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[0]-two[0] == two[1]-one[1] and one[0]-two[0] > 0 and one[1] - two[1] < 0):
            ans = min(ans,(one[0]-two[0])*10)

    prd = list(itertools.product(u,l))
    for j in prd:
        one = j[0]
        two = j[1]
        if(-one[0] + two[0] == one[1] - two[1] and one[0]-two[0] < 0 and one[1] - two[1] < 0):
            ans = min(ans,(two[0]-one[0])*10)
    
    prd = list(itertools.product(d,r))
    for j in prd:
        one = j[0]
        two = j[1]
        if(one[0]-two[0] == one[1]-two[1] and one[0]-two[0] > 0 and one[1] - two[1] < 0):
            ans = min(ans,(-two[0] + one[0])*10)

    prd = list(itertools.product(d,l))
    for j in prd:
        one = j[0]
        two = j[1]
        if(two[0]-one[0] == one[1] - two[1] and one[0]-two[0] < 0 and one[1] - two[1] > 0):
            ans = min(ans,(two[0] - one[0])*10)
    if(ans == 10**9):
        print("SAFE")
        return
    else:
        print(ans)
        return

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import numpy as np
tmp=[int(i) for i in input().split(' ')]
tmp_s=np.array([int(i) for i in input().split(' ')])
score=np.zeros(tmp[0]-tmp[1]+1)
for i in range(tmp[0]-tmp[1]+1):
  if i==0:
    score[0]=np.prod(tmp_s[:tmp[1]])
  else:
    if tmp_s[i-1]==0:
      score[i]=np.prod(tmp_s[i:i+tmp[1]-1])
    else:
      score[i]=tmp_s[i+tmp[1]-1]*score[i-1]/tmp_s[i-1]
    
    if score[i-1]<score[i]:
      print('Yes')
    else:
      print('No')

Submission status: Runtime Error

Solution code:
import numpy as np
tmp=[int(i) for i in input().split(' ')]
tmp_s=np.array([int(i) for i in input().split(' ')])
score=np.zeros(tmp[0]-tmp[1]+1)
for i in range(tmp[0]-tmp[1]+1):
  if i==0:
    score[0]=np.prod(tmp_s[:tmp[1]])
  else:
    if tmp_s[i-1]==0:
      score[i]=np.prod(tmp_s[i:i+tmp[1]])
    else:
      score[i]=tmp_s[i+tmp[1]]*score[i-1]/tmp_s[i-1]
    
    if score[i-1]<score[i]:
      print('Yes')
    else:
      print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
money = 1000
stock = 0
(*a,) = map(int, input().split())

for i in range(n - 1):
    if a[i] < a[i + 1]:
        stock += money // a[i]
        money = money % a[i]
    elif a[i] > a[i + 1]:
        money += stock * a[i]
        stock = 0
    else:
        pass
money += stock * a[-1]
print(money)

Submission status: Runtime Error

Solution code:
N=int(input())
souba=list(map(int,input().split()))
urikaiba=list()
money=1000
num=0
for i in range(1,N-1):
    if (souba[i]-souba[i-1])*(souba[i+1]-souba[i])<=0 and ((souba[i]-souba[i-1])!=0 or (souba[i+1]-souba[i])!=0) and (souba[i]-souba[i-1])!=0:
        urikaiba.append(souba[i])
urikaiba.insert(0,souba[0])
urikaiba.append(souba[N-1])
for i in range(len(urikaiba)-1):
    if urikaiba[i+1]-urikaiba[i]>0:
        num=money//urikaiba[i]
        money=money-num*urikaiba[i]
    elif urikaiba[i+1]-urikaiba[i]<0:
        money=money+num*souba[i]
        num=0
if num==0:
    print(money)
else:
    print(money+num*souba[N-1])

Submission status: Runtime Error

Solution code:
N, K = list(map(int,input().split()))

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

for i in range(N - K):
  list_a = list(A[i:i+K])
  list_b = list(A[i+1:i+K+1])
  if list_a < list_b:
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
tmp = [1] * (N+1)

for i in range(K, N+1):
    tmp[i] = sum(A_list[i-K:i])

for i in range(K+1, K+1+N-K):
    if tmp[i] > tmp[i-1]:
        print('Yes')
    else:
        print('No')