TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X, K, D = map(int, input().split(" "))
K_s = str(K)
K2 = int(K_s[len(K_s) - 1])

if K2 % 2 == 1:
    if X < 0:
        ans = X + D
    else:
        ans = X - D
else:
        ans = X

print(ans)


X, K, D = map(int, input().split(" "))
X = abs(X)

now = X
for _ in range(K):
    now = min(abs(now), now - D)
    
print(now)

X, K, D = map(int, input().split(" "))
X = abs(X)

a = X // D
b = X % D

remain_count = K - a

if remain_count < 0:
    ans = X - K * D
else:
    if remain_count % 2 == 0:
        ans = b
    else:
        ans = abs(b - D)
    
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x, move, d = map(int, input().split())

for k in range(move):
    move_plus = x + d
    move_minus = x - d

    if abs(move_plus) > abs(move_minus):
        x = move_minus
    else:
        x = move_plus

    if abs(x) <= d/2 and move-(k+1)%2==0:
        break
    else:
        x = x+d
        break

print(abs(x))


import numpy as np

x, move, d = map(int, input().split())

num = int(abs(x)/d)
ans = 0

if move <= num:
    if np.sign(x) == 1:
        ans = x-d*move
    else:
        ans = x+d*move

elif (move-num)%2==0:
    if np.sign(x) == 1:
        ans = x-d*num
    else:
        ans = x+d*num

elif (move-num)%2!=0:
    if np.sign(x) == 1:
        ans = x-d*(num+1)
    else:
        ans = x+d*(num+1)


print(abs(ans))


Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X, K, D = list(map(int, input().split()))
X = abs(X)
if K * D >= X:
    cgoal = X % D
    fgoal = abs(abs(cgoal) - D)
    times2cgoal = (X - cgoal) // D
    print(cgoal, fgoal, times2cgoal)
    if times2cgoal % 2 == K % 2:
        print(min(cgoal, fgoal))
    else:
        if X >= 0:
            print(fgoal)
else:
    print(X - K * D)

X, K, D = list(map(int, input().split()))
X = abs(X)
syo = X // D
#print(syo, amari)
if X <= K * D:
    K -= syo
    X -= D * syo
    if K % 2 == 0:
        print(X)
    else:
        print(abs(X - D))
else:
    print(X - K * D)
    
    

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X, K, D = map(int, input().split())
count1 = X // D
count2 = (X // D)-1
if count1 < K:
    if (K - count1) %2 ==0:
        print(abs(abs(X)-abs(D*count1)))
    else:
        print(abs(abs(X)-abs(D*count2)))
else:
    print(abs(abs(X)-abs(D*K)))

X, K, D = map(int, input().split())
count1 = abs(X) // D
count2 = (abs(X) // D)+1
if count1 < K:
    if (K - count1) %2 ==0:
        print(abs(abs(X)-abs(D*count1)))
        
    else:
        print(abs(abs(X)-abs(D*count2)))
else:
    print(abs(abs(X)-abs(D*K)))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x, k, d=map(int,input().split())
x=abs(x)

if x//d>=k:
  print(x-k*d)

elif k%2!=0:
  print(x%d)
else:
  print(x)

x, k, d=map(int,input().split())
x=abs(x)

if x//d>=k:
  print(x-k*d)
elif (k-x//d)%2==0:
  print(x%d)
else:
  print(abs(x-x//d*d-d))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X, K, D = map(int, input().split())

if X < 0:
  if K % 2 == 1:
    print(min(abs(X), abs(X+D)))
  else:
    print(abs(X))
else:
  if K % 2 == 1:
    print(min(abs(X), abs(X-D)))
  else:
    print(abs(X))

X, K, D = map(int, input().split())

if X+K*D < 0:
  print(abs(X+K*D))
elif X-K*D > 0:
  print(abs(X-K*D))
elif X+K*D == 0:
  print(0)
elif X-K*D == 0:
  print(0)
else:
  if X < 0:
    K1 = int(-X/D)+1
    K2 = K-K1
    if not K2 % 2:
      print(abs(X+K1*D))
    else:
      print(min(abs(X+K1*D+D), abs(X+K1*D-D)))
  else:
    K1 = int(X/D)+1
    K2 = K-K1
    if not K2 %2:
      print(abs(X-K1*D))
    else:
      print(min(abs(X-K1*D+D), abs(X-K1*D-D)))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X,K,D = map(int, input().split())


if K %2 == 0:
  if X//D > K:
    print(X%D)
  else:
    print(X%D + (X//D -K)*D)
else:
  if X//D > K:
    if abs(X%D-D) < abs(X%D +D):
      print(abs(X%D-D))
    else:
      print(abs(X%D +D))
  else:
    print(X%D + (X//D -K)*D)

x,k,d = map(int,input().split())

n = abs(x)//d 

if n < k:
  if (k-n) % 2 == 1:
    print(abs(abs(x) - n*d - d))
  else:
    print(abs(abs(x) - n*d))
else:
  print(abs(abs(x) - k*d))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x,k,d=map(int,input().split())
kai=x//d
k-=kai
if k%2 ==0:
    y=x-(kai*d)
else:
    y=x-(kai*d+1)
print(abs(y))

x,k,d=map(int,input().split())
x=abs(x)
kai=x//d
if k < kai:
    print(x-d*k)
else:
    k-=kai
    if k%2 ==0:
        y=x-(d*kai)
    else:
        y=x-(d*(kai+1))
    print(abs(y))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X, K, D = map(int, input().split())

def sign(x):
    return 1 if x >= 0 else -1


ans = abs(X) - K * D

if abs(X) - K * D < 0:
    divs = abs(X) // D
    mods = abs(X) % D
    nums = K - divs

    print(divs, mods, nums)

    ans = abs(mods - (nums%2) * D)

    # if nums % 2 == 0:
    #     ans = mods
    # else:
    #     ans = min(mods, abs(mods - D))


print(ans)



# 
# print(ans)


X, K, D = map(int, input().split())


def sign(x):
    return 1 if x >= 0 else -1


if abs(X) >= D * K:
    ans = X - sign(X) * D * K
else:
    l = abs(X) // D
    mod = abs(X) % D

    residual = K - l

    if residual % 2 == 0:
        ans = mod
    else:
        ans = mod - sign(mod) * D

print(abs(ans))




Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x,k,d=map(int,input().split())
for n in range(k):
  a=abs(x-d)
  b=abs(x+d)
  if a<=b:
    x=x-d
  else:
    x=x+d
print(x)

x,k,d=map(int,input().split())
x=abs(x)
a=x//d
if a>=k:
  ans=x-(k*d)
else:
  b=x%d
  c=d-b
  if b<=c:
    if (k-a)%2==0:
      ans=b
    else:
      ans=c
  else:
    if (k-a)%2==0:
      ans=b
    else:
      ans=c
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x, k, d = map(int, input().split())

if abs(x)//d>=k:
    print(abs(x)-k*d)
    exit()

s = x

while k>0:
    s = s-d
    print(s,x)
    if abs(s)>=abs(x):
        break
    x = s
    k -= 1

if k == 0:
    print(abs(s))
    exit()

if d%2 == 0:
    print(abs(s))
else:
    print(abs(x))

x, k, d = map(int, input().split())
x = abs(x)
e = x//d

if e>k:
    print(x-d*k)
else:
    if (k-e)%2 == 0:
        print(abs(x-d*e))
    else:
        print(abs(x-d*(e+1)))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x,k,d = map(int,input().split())

x = abs(x)
ans = 0
syo = x//d
amari = x%d
if x == 0:
    if syo >= k:
        ans = x -k*d
    elif syo < k:
        if x-syo*d > 0:
            if k%2==0:
                ans = x-syo*d
            else:
                ans = abs(x - d)
        elif x-syo*d ==0:
            if k%2==0:
                ans = x
            else:
                ans = 0
        else:
            x = x - syo * d
            k = k-syo
            if k%2 == 0:
                ans = x
            else:
                ans = abs(x - d)
else:
    ans = 0

print(ans)   

x,k,d = map(int,input().split())

x = abs(x)
syo = x//d
kk = k - syo
xx = x - syo*d

if k <= syo:
    ans = x-d*k
else:
    if kk%2 == 0:
        ans = xx
    else:
        ans = abs(xx-d)

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):

x,k,d = map(int,input().split())
x = abs(x)
if (x//d) >=k:
    ans = x - d*k
y = x-(x//d)*d
elif k- (x//d)%2 != 0:
    ans = y
else:
    ans = y-d
print(abs(ans))


x,k,d = map(int,input().split())
x = abs(x)
if (x//d) > k:
    ans = x - d*k
elif (k-(x//d))%2 == 0:
    y = x-(x//d)*d
    ans = y
else:
    y = x-(x//d)*d
    ans = y-d
print(abs(ans))

Verdicts: Runtime Error

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x,k,d=map(int,input().split())
x,d=abs(x),abs(d)
m=x//d
if m>=k:
    print(x-k*d)
else:
    t=k-m
    t=t%2
    if t==0:
        print(min(x-m*d,x-m*d+2*d))
    else:
        print(x-m*d+d)

x,k,d=map(int,input().split())
x,d=abs(x),abs(d)
m=x//d
if m>=k:
    print(x-k*d)
else:
    t=k-m
    t=t%2
    if t==0:
        print(x-m*d)
    else:
        print(x-m*d+d)

x,k,d=map(int,input().split())
x,d=abs(x),abs(d)
m=x//d
if m>=k:
    print(x-k*d)
else:
    t=k-m
    t=t%2
    if t==0:
        print(x-m*d)
    else:
        print(min(x-m*d+d,abs(x-(m+1)*d)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
X,K,D = map(int,input().split())

q = X // D
mod = X % D

if q > K:
    ans = abs(abs(X)-K*D)
elif q==K:
    ans = mod
else:
    if abs(mod) <= abs(amod):
        if (K-q)%2 == 1:
            ans = D - mod
        else:
            ans = mod



print(ans)

X,K,D = map(int,input().split())

q = X // D
mod = X % D

if q >= K:
    ans = abs(abs(X)-K*D)
else:
    if K%2 != q%2:
        a1 = mod - K
        a2 = mod + K
        ans = min(abs(a1),abs(a2))
    else:
        ans = mod

print(ans)

X,K,D = map(int,input().split())

X = abs(X)
q = X // D
mod = X % D

if q > K:
    ans = abs(abs(X)-K*D)
elif q==K:
    ans = mod
else:
    ans1 = D-mod
    ans2 = mod

    if ans1<ans2:
        if (K-q-1)%2==1:
            ans = ans2
        else:
            ans = ans1
    else:
        if (K-q)%2==1:
            ans = ans1
        else:
            ans = ans2



print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Takahashi, who lives on the number line, is now at coordinate X. He will make exactly K moves of distance D in the positive or negative direction.  More specifically, in one move, he can go from coordinate x to x + D or x - D.  He wants to make K moves so that the absolute value of the coordinate of the destination will be the smallest possible.  Find the minimum possible absolute value of the coordinate of the destination.

Submission attempts (in order):
x,k,d=map(int,input().split())

x=abs(x)
i=x//d

print(i)
if i>=k:
    print(x-d*k)
else:
    if (k-i)%2==0:
        print(x-d*i)
    else:
        print(abs(x-d*(i+1)))

x,k,d=map(int,input().split())

x=abs(x)
i=x//d

if i>=k:
    print(x-d*k)
else:
    if (k-i)%2==0:
        print(x-d*i)
    else:
        print(abs(x-d*(i+1)))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi will play a game using a piece on an array of squares numbered 1, 2, \cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \cdots, N: P_1, P_2, \cdots, P_N.  Now, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):    * In one move, if the piece is now on Square i (1 \leq i \leq N), move it to Square P_i. Here, his score increases by C_{P_i}.  Help him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)

Submission attempts (in order):
import math
N, K = map(int, input().split())

def main()
    plist = [i - 1 for i in map(int, input().split())]
    slist = list(map(int, input().split()))
    max_score = -math.inf
    for start in range(N):
        total_score_in_loop = 0
        now = start
        score_loop = []
        while True:
            now = plist[now]
            total_score_in_loop += slist[now]
            score_loop.append(slist[now])
            if now == start:
                break
        score_rem = 0
        loop_score = 0
        for index, score in enumerate(score_loop, start=1):
            score_rem += score
            if total_score_in_loop > 0:
                loop_score = total_score_in_loop * ((K-index) // len(score_loop))
            max_score = max(max_score, score_rem+loop_score)
    print(max_score)

if __name__ == '__main__':
    main()

import numpy as np
from numba import njit

@njit('i8(i8,i8,i8[:],i8[:],i8)', cache=True)
def get_max_score(N, K, plist, slist, max_score):
    for start in range(N):

        total_score_in_loop = 0
        score_loop = []
        now = start
        while True:
            now = plist[now]
            total_score_in_loop += slist[now]
            score_loop.append(slist[now])
            if now == start:
                break
        
        rem_score, loop_score = 0, 0
        for idx in range(1, len(score_loop)+1):
            rem_score += score_loop[idx-1]
            if total_score_in_loop > 0:
                loop_score = ((K - idx) // len(score_loop)) * total_score_in_loop
            max_score = max(max_score, rem_score + loop_score)
    return max_score

def main():
    N, K = map(int, input().split())
    plist = np.array([i-1 for i in map(int, input().split())], dtype='int64')
    slist = np.array([i for i in map(int, input().split())], dtype='int64')
    max_score = -10**15
    max_score = get_max_score(N, K, plist, slist, max_score)
    print(max_score)

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: There are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \leq i \leq R) and the j-th column (1 \leq j \leq C). The i-th item is at (r_i, c_i) and has the value v_i.  Takahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).  He can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.  Find the maximum possible sum of the values of items he picks up.

Submission attempts (in order):
import sys
import numpy as np
from numba import jit, void, i8
input = sys.stdin.readline

def main():
    R, C, K = map(int, input().split())

    L_INF = int(1e17)
    dp = np.full((R+1, C+1, 4), -L_INF, dtype=np.int64)
    cell = np.full((R+1, C+1), 0, dtype=np.int64)

    for i in range(K):
        x, y, c = map(int, input().split())
        cell[x-1][y-1] = c

    f(dp, cell, R, C)

    print(dp[R][C][3])

@njit(void(i8[:,:,:],i8[:,:],i8,i8))
def f(dp, cell, R, C):
    dp[0][1][0] = dp[1][0][0] = 0
    for i in range(1, R + 1):
        for j in range(1, C + 1):
            for k in range(4):
                if k > 0:
                    dp[i][j][k] = max(dp[i][j][k], dp[i][j][k-1])
                dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k])
                if k > 0:
                    dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k-1] + cell[i-1][j-1])
                if k == 1:
                    dp[i][j][k] = max(dp[i][j][1], dp[i-1][j][3] + cell[i-1][j-1])

if __name__ == "__main__":
    main()


import sys
import numpy as np
from numba import njit, void, i8

def main():
    R, C, K = map(int, readline().split())
    items = np.array(read().split(), dtype=np.int64)
    print(calc(R, C, K, items))

@njit(i8(i8, i8, i8, i8[:]), cache=True)
def calc(R, C, K, items):
    cell = np.zeros((R, C), dtype=np.int64)
    for i in range(0, K*3, 3):
        x, y, c = items[i:i+3]
        cell[x-1, y-1] = c
    L_INF = int(1e17)
    dp = np.full((R+1, C+1, 4), -L_INF, dtype=np.int64)
    dp[0, 1, 0] = dp[1, 0, 0] = 0
    for i in range(1, R + 1):
        for j in range(1, C + 1):
            for k in range(4):
                dp[i, j, k] = max(dp[i, j, k], dp[i, j-1, k])
                if k > 0:
                    dp[i, j, k] = max(dp[i, j, k], dp[i, j, k-1])
                    dp[i, j, k] = max(dp[i, j, k], dp[i, j-1, k-1] + cell[i-1, j-1])
                if k == 1:
                    dp[i, j, 1] = max(dp[i, j, 1], dp[i-1, j, 3] + cell[i-1, j-1])
    return dp[R, C, 3]

if __name__ == "__main__":
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline

    if __file__=="test.py":
        f = open("./in_out/input.txt", "r", encoding="utf-8")
        read = f.read
        readline = f.readline

    main()


Verdicts: Runtime Error

Accepted
Problem: There are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \leq i \leq R) and the j-th column (1 \leq j \leq C). The i-th item is at (r_i, c_i) and has the value v_i.  Takahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).  He can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.  Find the maximum possible sum of the values of items he picks up.

Submission attempts (in order):
import numpy as np
from numba import njit, i8


R, C, K = map(int, input().split())
rcvs = [list(map(int, input().split())) for _ in range(K)]

@njit
def solve(rcvs):
    rcvs = np.array(rcvs, dtype=np.int64)
    
    for i in range(len(rcvs)):
        rcvs[i,0] -= 1
        rcvs[i,1] -= 1
    
    rewards = np.array([[0 for _ in range(C)] for _ in range(R)], dtype=np.int64)
    
    for rcv in rcvs:
        rewards[rcv[0],rcv[1]] = rcv[2]
    
    dp = np.array([[[0 for _ in range(4)] for _ in range(C+1)] for _ in range(R+1)], dtype=np.int64)
    
    for i in range(R):
        for j in range(C):
            reward = rewards[i][j]
            dp[i+1,j+1,0] = max(dp[i,j+1])
            dp[i+1,j+1,1] = dp[i+1,j+1,0] + reward
            
            for k in range(4): # move downside without selecting
                dp[i+1,j+1,k] = max(dp[i+1,j,k], dp[i+1,j+1,k])
            for k in range(3):
                dp[i+1,j+1,k+1] = max(dp[i+1,j,k]+reward,dp[i+1,j+1,k+1])
    print(np.max(dp[-1,-1]))

if __name__ == "__main__":
    solve(rcvs)

import sys
import numpy as np
import numba
from numba import njit, b1, i4, i8, f8
import sys

R, C, K = map(int, input().split())
rcvs = [list(map(int, input().split())) for _ in range(K)]
rcvs = np.array(rcvs, dtype=np.int64)
#%%
@njit
def main(rcvs):
    rewards = np.zeros((R, C), dtype=np.int64)
    
    for i in range(len(rcvs)):
        rewards[rcvs[i][0]-1][rcvs[i][1]-1] = rcvs[i][2]
    
    dp = np.zeros((R+1, C+1, 4), dtype=np.int64)
    
    for i in range(R):
        for j in range(C):
            reward = rewards[i][j]
            dp[i+1][j+1][0] = max(dp[i][j+1])
            dp[i+1][j+1][1] = dp[i+1][j+1][0] + reward
            
            for k in range(4): # move downside without selecting
                dp[i+1][j+1][k] = max(dp[i+1][j][k], dp[i+1][j+1][k])
            if reward > 0:
                for k in range(3):
                    dp[i+1][j+1][k+1] = max(dp[i+1][j][k]+reward,dp[i+1][j+1][k+1])
    return max(dp[-1][-1])

print(main(rcvs))



Verdicts: Runtime Error

Accepted
Problem: There are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \leq i \leq R) and the j-th column (1 \leq j \leq C). The i-th item is at (r_i, c_i) and has the value v_i.  Takahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).  He can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.  Find the maximum possible sum of the values of items he picks up.

Submission attempts (in order):


import numpy as np
from numba import njit
def main():
    R, C, K = map(int, input().split())
    field = np.full((R+1,C+1), 0)
    dpt = np.full((R+1,C+1,4), 0)
    for i in range(K):
        r, c, v = map(int, input().split())
        field[r][c] = v
    dp(R, C, field, dpt)
    print(max(dpt[-1][-1]))
    print(field)
    print(dpt)

def dp(R, C, field, dpt):
    for r in range(1, R+1):
        for c in range(1, C+1):
            for taken in range(4):
                max_v = 0
                if taken == 0:
                    max_v = max(dpt[r-1][c])
                    max_v = max(dpt[r][c-1][0], max_v)
                elif taken == 1:
                    max_v = max(dpt[r][c-1][taken-1] + field[r][c],
                                dpt[r][c-1][taken],
                                max(dpt[r-1][c]) + field[r][c])
                else:
                    max_v = max(dpt[r][c-1][taken-1] + field[r][c],
                                dpt[r][c-1][taken])
                dpt[r][c][taken] = max_v
    return True

if __name__ == '__main__':
    main()


import numpy as np
from numba import njit
def main():
    R, C, K = map(int, input().split())
    field = np.full((R+1,C+1), 0, dtype='int64')
    dpt = np.full((R+1,C+1,4), 0, dtype='int64')
    for i in range(K):
        r, c, v = map(int, input().split())
        field[r][c] = v
    dp(R, C, field, dpt)
    print(max(dpt[-1][-1]))

@njit('i4(i4,i4,i8[:,:],i8[:,:,:])', cache=True)
def dp(R, C, field, dpt):
    for r in range(1, R+1):
        for c in range(1, C+1):
            for taken in range(4):
                max_v = 0
                if taken == 0:
                    max_v = max(dpt[r-1][c])
                    max_v = max(dpt[r][c-1][0], max_v)
                elif taken == 1:
                    max_v = max(dpt[r][c-1][taken-1] + field[r][c],
                                dpt[r][c-1][taken],
                                max(dpt[r-1][c]) + field[r][c])
                else:
                    max_v = max(dpt[r][c-1][taken-1] + field[r][c],
                                dpt[r][c-1][taken])
                dpt[r][c][taken] = max_v
    return 1

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: There are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \leq i \leq R) and the j-th column (1 \leq j \leq C). The i-th item is at (r_i, c_i) and has the value v_i.  Takahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).  He can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.  Find the maximum possible sum of the values of items he picks up.

Submission attempts (in order):
from namba import jit
import numpy as np
@jit
def main():
  R,C,K=map(int,input().split())
  scores=np.zeros((R,C),np.int64)
  for _ in range(K): 
    r,c,v=map(int,input().split())
    scores[r-1][c-1]=v
  dp=np.zeros((R+1,C+1,4),np.int64) 
  for i in range(1,R+1):
    for j in range(1,C+1):
      for k in range(4):
        dp[i][j][k]=max(dp[i][j-1][k],dp[i-1][j][3]) 
      for k in range(3,0,-1):
        dp[i][j][k]=max(dp[i][j][k],dp[i][j][k-1]+scores[i-1][j-1]) 
  return dp[R][C][3]
print(main())

from numba import jit
import numpy as np
@jit
def main():
  R,C,K=map(int,input().split())
  scores=np.zeros((R,C),np.int64)
  for _ in range(K): 
    r,c,v=map(int,input().split())
    scores[r-1][c-1]=v
  dp=np.zeros((R+1,C+1,4),np.int64) 
  for i in range(1,R+1):
    for j in range(1,C+1):
      for k in range(4):
        dp[i][j][k]=max(dp[i][j-1][k],dp[i-1][j][3]) 
      for k in range(3,0,-1):
        dp[i][j][k]=max(dp[i][j][k],dp[i][j][k-1]+scores[i-1][j-1]) 
  return dp[R][C][3]
print(main())


Verdicts: Runtime Error

Accepted
Problem: There are K items placed on a grid of squares with R rows and C columns. Let (i, j) denote the square at the i-th row (1 \leq i \leq R) and the j-th column (1 \leq j \leq C). The i-th item is at (r_i, c_i) and has the value v_i.  Takahashi will begin at (1, 1), the start, and get to (R, C), the goal. When he is at (i, j), he can move to (i + 1, j) or (i, j + 1) (but cannot move to a non-existent square).  He can pick up items on the squares he visits, including the start and the goal, but at most three for each row. It is allowed to ignore the item on a square he visits.  Find the maximum possible sum of the values of items he picks up.

Submission attempts (in order):
import sys
from numba import njit

R, C, K = map(int, input().split())
item = [[0]*C for _ in range(R)]
for s in sys.stdin.readlines():
    r, c, v = map(int, s.split())
    item[r-1][c-1] = v

@njit
def solve(R, C, K, item):
    DP = [[[0, 0, 0, 0] for _ in range(C)] for _ in range(R)]

    DP[0][0][1] = item[0][0]

    for i in range(R):
        for j in range(C):
            for k in range(4):
                if i > 0:  
                    DP[i][j][0] = max(DP[i][j][0], max(DP[i-1][j]))  
                    DP[i][j][1] = max(DP[i][j][1], max(DP[i-1][j])+item[i][j])  

                if j > 0:  
                    DP[i][j][k] = max(DP[i][j][k], DP[i][j-1][k])  
                    if k >= 1:
                        DP[i][j][k] = max(DP[i][j][k], DP[i][j-1][k-1]+item[i][j])  

    print(max(DP[R-1][C-1]))

solve(R, C, K, item)

import numpy as np
from numba import njit

R, C, K = map(int, input().split())
item = np.zeros((R, C), np.int_)
for _ in range(K):
    r, c, v = map(int, input().split())
    item[r-1,c-1] = v

@njit
def solve(R, C, K, item):
    DP = np.zeros((R, C, 4), np.int_)

    DP[0][0][1] = item[0][0]

    for i in range(R):
        for j in range(C):
            for k in range(4):
                if i > 0:  
                    DP[i,j,0] = max(DP[i,j,0], max(DP[i-1,j]))  
                    DP[i,j,1] = max(DP[i,j,1], max(DP[i-1,j])+item[i,j])  

                if j > 0:  
                    DP[i,j,k] = max(DP[i,j,k], DP[i,j-1,k])  
                    if k >= 1:
                        DP[i,j,k] = max(DP[i,j,k], DP[i,j-1,k-1]+item[i,j])  

    print(max(DP[R-1,C-1]))

solve(R, C, K, item)

Verdicts: Runtime Error

Accepted
Problem: We have N strings of lowercase English letters: S_1, S_2, \cdots, S_N.  Takahashi wants to make a string that is a palindrome by choosing one or more of these strings - the same string can be chosen more than once - and concatenating them in some order of his choice.  The cost of using the string S_i once is C_i, and the cost of using it multiple times is C_i multiplied by that number of times.  Find the minimum total cost needed to choose strings so that Takahashi can make a palindrome.  If there is no choice of strings in which he can make a palindrome, print -1.

Submission attempts (in order):
print(1)

from random import randrange
from heapq import heapify, heappush, heappop
from time import time
K = 60
rand = lambda: randrange(1 << K)
sTime = time()
N = int(input())
S, IS, C = [], [], []
for _ in range(N):
    s, c = input().split()
    S.append(s)
    IS.append(s[::-1])
    C.append(int(c))

D = {}
done = [set(), set()]
r = rand()
D[r] = (0, "", 0)
H = [r]
ans = 1 << K
while H:
    r = heappop(H)
    if time() - sTime > 1.7:
        break
    d, s, c = D[r]
    if s in done[d]: continue
    done[d].add(s)
    if d == 0:
        for ss, cc in zip(S, C):
            m = min(len(s), len(ss))
            if s[:m] == ss[:m]:
                if abs(len(s) - len(ss)) <= 1 or len(ss) > len(s) and ss[m:] == ss[m:][::-1]:
                    ans = min(ans, c + cc)
                else:
                    if len(s) < len(ss):
                        r = rand() + (c + cc << K)
                        D[r] = (1, ss[m:], c + cc)
                        heappush(H, r)
                    else:
                        r = rand() + (c + cc << K)
                        D[r] = (0, s[m:], c + cc)
                        heappush(H, r)
    else:
        for ss, cc in zip(IS, C):
            m = min(len(s), len(ss))
            if s[:m] == ss[:m]:
                if abs(len(s) - len(ss)) <= 1 or len(ss) > len(s) and ss[m:] == ss[m:][::-1]:
                    ans = min(ans, c + cc)
                else:
                    if len(s) < len(ss):
                        r = rand() + (c + cc << K)
                        D[r] = (0, ss[m:], c + cc)
                        heappush(H, r)
                    else:
                        r = rand() + (c + cc << K)
                        D[r] = (1, s[m:], c + cc)
                        heappush(H, r)

print(ans if ans < 1 << K - 2 else -1)

Verdicts: Wrong Answer

Accepted
Problem: Let’s take a prime P = 200\,003. You are given N integers A_1, A_2, \ldots, A_N. Find the sum of ((A_i \cdot A_j) \bmod P) over all N \cdot (N-1) / 2 unordered pairs of elements (i < j).  Please note that the sum isn't computed modulo P.

Submission attempts (in order):
import numpy 
 
def convolve(g, h):
  s=len(g)+len(h)+1
  n=1
  while n<s:
    n*=2
  gg=numpy.fft.fft(g+[0]*(n-len(g)))
  hh=numpy.fft.fft(h+[0]*(n-len(h)))
  ff=[gg[i]*hh[i] for i in range(n)]
  ff=numpy.fft.ifft(ff)
  ans=[int(ff[i].real+0.5) for i in range(n)]
  return ans

p=200003
n=int(input())
arr=list(map(int,input().split()))
pos={}
tmp=1
for i in range(p):
  pos[tmp]=i
  tmp*=2
  tmp%=p
cnt1=[0]*p
cnt2=[0]*p
for val in arr:
  if val!=0:
    cnt1[pos[val]]+=1
    cnt2[pos[val]]+=1
ans=convolve(cnt1,cnt2)
for val in arr:
  ans[pos[val]*2]-=1
total=0
for i in range(len(ans)):
  if ans[i]!=0:
    total+=(ans[i]//2)*pow(2,i,p)
print(total)

import numpy 
 
def convolve(g, h):
  s=len(g)+len(h)+1
  n=1
  while n<s:
    n*=2
  gg=numpy.fft.fft(g+[0]*(n-len(g)))
  hh=numpy.fft.fft(h+[0]*(n-len(h)))
  ff=[gg[i]*hh[i] for i in range(n)]
  ff=numpy.fft.ifft(ff)
  ans=[int(ff[i].real+0.5) for i in range(n)]
  return ans

p=200003
n=int(input())
arr=list(map(int,input().split()))
pos={}
tmp=1
for i in range(p):
  pos[tmp]=i
  tmp*=2
  tmp%=p
cnt1=[0]*p
cnt2=[0]*p
for val in arr:
  if val!=0:
    cnt1[pos[val]]+=1
    cnt2[pos[val]]+=1
ans=convolve(cnt1,cnt2)
for val in arr:
  if val!=0:
    ans[pos[val]*2]-=1
total=0
for i in range(len(ans)):
  if ans[i]!=0:
    total+=(ans[i]//2)*pow(2,i,p)
print(total)

Verdicts: Runtime Error

Accepted
Problem: Let’s take a prime P = 200\,003. You are given N integers A_1, A_2, \ldots, A_N. Find the sum of ((A_i \cdot A_j) \bmod P) over all N \cdot (N-1) / 2 unordered pairs of elements (i < j).  Please note that the sum isn't computed modulo P.

Submission attempts (in order):
import sys
import numpy as np

def fft_convolve(f, g):
    
    fft = np.fft.rfft
    ifft = np.fft.irfft
    Lf = len(f)
    Lg = len(g)
    L = Lf + Lg - 1
    fft_len = 1 << L.bit_length()
    fl = f & (1 << 15) - 1
    fh = f >> 15
    gl = g & (1 << 15) - 1
    gh = g >> 15

    def conv(f, g):
        return ifft(fft(f, fft_len) * fft(g, fft_len))[:L]

    x = conv(fl, gl)
    y = conv(fl + fh, gl + gh)
    z = conv(fh, gh)
    a, b, c = map(lambda x: (x + .5).astype(np.int64), [x, y, z])
    return (a + ((b - a - c) << 15) + (c << 30))


ROOT=2
P=200003
pw=[1]*(P-1)
lg=[-1]*P

for i in range(1,len(pw)):
    pw[i]=ROOT*pw[i-1]%P
for i in range(len(pw)):
    lg[pw[i]]=i

N=int(input())
A=np.array([int(x) for x in input().split()],dtype=np.int64)
B=[0]*P
for a in A:
    if a==0:
        continue
    B[lg[a]]+=1
B=np.array(B,dtype=np.int64)
C=fft_convolve(B,B)
ans=0
for a in A:
    ans-=a*a%(P-1)
for i in range(len(C)):
    ans+=C[i]*pw[i%(P-1)]
ans//=2
print(ans)


import sys
import numpy as np

def fft_convolve(f, g):
    
    fft = np.fft.rfft
    ifft = np.fft.irfft
    Lf = len(f)
    Lg = len(g)
    L = Lf + Lg - 1
    fft_len = 1 << L.bit_length()
    fl = f & (1 << 15) - 1
    fh = f >> 15
    gl = g & (1 << 15) - 1
    gh = g >> 15

    def conv(f, g):
        return ifft(fft(f, fft_len) * fft(g, fft_len))[:L]

    x = conv(fl, gl)
    y = conv(fl + fh, gl + gh)
    z = conv(fh, gh)
    a, b, c = map(lambda x: (x + .5).astype(np.int64), [x, y, z])
    return (a + ((b - a - c) << 15) + (c << 30))


ROOT=2
P=200003
pw=[1]*(P-1)
lg=[-1]*P

for i in range(1,len(pw)):
    pw[i]=ROOT*pw[i-1]%P
for i in range(len(pw)):
    lg[pw[i]]=i

N=int(input())
A=np.array([int(x) for x in input().split()],dtype=np.int64)
B=[0]*P
for a in A:
    if a==0:
        continue
    B[lg[a]]+=1
B=np.array(B,dtype=np.int64)
C=fft_convolve(B,B)
ans=0
for a in A:
    ans-=a*a%P
for i in range(len(C)):
    ans+=C[i]*pw[i%(P-1)]
ans//=2
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Let’s take a prime P = 200\,003. You are given N integers A_1, A_2, \ldots, A_N. Find the sum of ((A_i \cdot A_j) \bmod P) over all N \cdot (N-1) / 2 unordered pairs of elements (i < j).  Please note that the sum isn't computed modulo P.

Submission attempts (in order):
import scipy.fftpack as F
from numpy import *
m=200003
n=int(input())
a=[0]*m
b=[0]*m
ans=0
for i in range(m-1):
    a[pow(2,i,m)]=i
for i in map(int,input().split()):
    if i:
        b[a[i]]+=1
        ans-=i*i%m
b=array(b,dtype=float64)
b=F.fft(b)
b=b*b
b=F.ifft(b)
for i,j in enumerate(b):
    ans+=int(round(j.real))*pow(2,i,m)
print(ans//2)

import scipy.fftpack as F
from numpy import *
m=200003
n=int(input())
a=[0]*m
b=[0]*(m-1)
ans=0
for i in range(m-1):
    a[pow(2,i,m)]=i
for i in map(int,input().split()):
    if i:
        b[a[i]]+=1
        ans-=i*i%m
b=array(b,dtype=float64)
b=F.fft(b)
b=b*b
b=F.ifft(b)
for i,j in enumerate(b):
    ans+=int(round(j.real))*pow(2,i,m)
print(ans//2)

Verdicts: Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
temp=int(input())
if(temp<=30):
    print("Yes")
else:
    print("No")

temp=int(input())
if(temp<35):
    print("Yes")
else:
    print("No")

temp=int(input())
if(temp>=30):
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
X=int(input())
if x>=30:
  print(Yes)
else:
  print(No)

X=int(input())
if x>=30:
  print("Yes")
else:
  print("No")

x=int(input())
if x>=30:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

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

if X <= 30:
    print('Yes')
else:
    print('No')

X = int(input())

if 30 <= X:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

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

if X>=30:
  print('YES')
else:
  print('NO')

X = int(input())

if X>=30:
  print('Yes')
else:
  print('No')


Verdicts: Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
if X>= 30:
    print('yes')
else:
    print('no')


X = int(input())
if X>= 30:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
if X >= 30:
    print('Yes')
else:
    print('No')

def switch(X):
  if X >= 30:
    print('Yes')
  else:
    print('No')

if input() >= 30:
    print('Yes')
else:
    print('No')

if int(input()) >= 30:
    print('Yes')
else:
    print('No')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
X = input()
if X>=30:
  print("Yes")
else:
  print("No")

X = int(input())
if X>=30:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
#include <stdio.h>

int main(){
  int x;
  scanf("%d", &x);
  
  if (x >= 30){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  
  return 0;
}

x = int(input())
if x >= 30:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
x=int(input())
if x>=30:
  print("YES")
else:
  print("NO")

x = int(input())
if x >= 30:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
int X=input()
if(X==30):
  print("Yes")
else:
  print("No")


X=int(input())
if(X<=40 and X>=-40):
    if(X>=30):
        print("Yes")
    else:
        print("No")

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

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

if t >= 30:
  print('Yes')
else:
  print('No')

t = int(input())

if t >= 30:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
x=int(input)
if x >=30:
  print("Yes")
else:
  print('No')

x=int(input())
if x >=30:
  print("Yes")
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

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

if 30<=n:
    print('Yes')
else :
    print('No')


n=input()

if 30<=n:
    print('Yes')
else :
    print('No')


n=int(input())

if 30<=n:
    print('Yes')
else :
    print('No')


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
x = int(input())
if x=>30:
    print("Yes")
else:
    print("No")


x = int(input())
if x>=30:
    print("Yes")
else:
    print("No")


Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

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

if X >= 30:
  print("Yes")
else:
  print("No")

x = int(input())
if x >= 30:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):

x = int(input("入力: "))


if x >= 30:
    print("Yes")
elif x < 30:
    print("No")
else:
    print("エラー")


x = int(input())


if x >= 30:
    print("Yes")
elif x < 30:
    print("No")
else:
    print("エラー")

Verdicts: Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
x = int(input())
ans = 'YES' if x >= 30 else 'NO'
print(ans)

x = int(input())
ans = 'Yes' if x >= 30 else 'No'
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
x = input()
if(x >= 30):
  print('Yes')
  else:
        print('No')

x = int(input())
if x >= 30:
  print('Yes')
else:
  print('No')

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
X =int(input())
if X >= 30:
    print("Yes")


X =int(input())
if X <= 30:
    print("Yes")


X =int(input())
if X >= 30:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

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

    if x >= 30:
        print("Yes")
    else:
        print("No")


x = int(input())

if x >= 30:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.  The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Submission attempts (in order):
X=input()
if X >=30:
    print("Yes")
else:
    print("No")

x=int(input())
if x >=30:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted