TnT/CodeNet4Repair huggingface dataset:
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
d = {}
for i in range(N):
  x = input()
  if x in d.keys():
    d[x]+=1 
  else:
    d[x] = 1
for j in d.keys():
  print(j + " " + "x" + " " + str(d[j]))
  print("\n")
  

Fixed, accepted submission:
N = int(input())
ac = 0

wa = 0
tle = 0
re = 0
while (N) :
    x = input()
    if x == 'AC':
        ac+=1
    if x == 'WA':
        wa +=1
    if x == 'TLE':
        tle += 1
    if x == 'RE':
        re += 1
    N-=1
print('AC' + " " + "x" + " " + str(ac))
print('WA' + " " + "x" + " " + str(wa))
print('TLE' + " " + "x" + " " + str(tle))
print('RE' + " " + "x" + " " + str(re))
Problem:
Snuke loves working out. He is now exercising N times.  Before he starts exercising, his _power_ is 1. After he exercises for the i-th time, his power gets multiplied by i.  Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Incorrect submission (verdict: Wrong Answer):
n=int(input())

ans=1

for i in range(n+1):
    ans*=1

print(ans%(10**9+7))

Fixed, accepted submission:
n=int(input())

ans=1

for i in range(1,n+1):
    ans=(ans*i)%(10**9+7)

print(ans)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

answer = N / 1000
print(answer)


Fixed, accepted submission:
import math

N = int(input())

answer = math.ceil(N / 1000)
answer = answer * 1000 - N
print(answer)
Problem:
Iroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L.  She will concatenate all of the strings in some order, to produce a long string.  Among all strings that she can produce in this way, find the lexicographically smallest one.  Here, a string s=s_1s_2s_3...s_n is _lexicographically smaller_ than another string t=t_1t_2t_3...t_m if and only if one of the following holds:    * There exists an index i(1≦i≦min(n,m)), such that s_j = t_j for all indices j(1≦j<i), and s_i<t_i.   * s_i = t_i for all integers i(1≦i≦min(n,m)), and n<m.

Incorrect submission (verdict: Wrong Answer):
n, l = map(int, input().split())
d = {input() for _ in range(n)}
print(sorted(d))

Fixed, accepted submission:
n, l = map(int, input().split())
d = sorted([input() for _ in range(n)])
print(''.join(d))
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
s = str(input())
Acount = 0
Zcount = 0
for i in range (len(s)):
    if s[i] == 'A':
        Acount = i
        break

for j in range (len(s)):
    if s[j] == 'Z':
        Zcount = j

print(j - i +1)

Fixed, accepted submission:
s = str(input())
Acount = 3000000
Zcount = 0
for i in range (len(s)):
    if (s[i] == 'A' and i < Acount):
        Acount = i

for j in range (len(s)):
    if (s[j] == 'Z' and j > Zcount):
        Zcount = j

print(Zcount - Acount +1)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
a = int(input())
if a > 10000000:
    print(f"{a-10000000}")
else:
    print(f"{a % 1000}")

Fixed, accepted submission:
N = int(input())
print(f"{-N % 1000}")
Problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.

Incorrect submission (verdict: Wrong Answer):
a, b = map(int, input().split())

c = a*b %2
if c:
  print('odd')
else:
  print('even')


Fixed, accepted submission:
a, b = map(int, input().split())

c = a*b %2
if c:
  print('Odd')
else:
  print('Even')
Problem:
You are given a string S of length 3 consisting of `a`, `b` and `c`. Determine if S can be obtained by permuting `abc`.

Incorrect submission (verdict: Wrong Answer):
S=input()
t=[a for a in S]
number=0
for a in range(2):
    if 'a' in t:
        number+=1
    elif 'b' in t:
        number+=1
    elif 'c' in t:
        number+=1
if number==3:
    print('Yes')
else:
    print('No')
    

Fixed, accepted submission:
S=input()
t=[a for a in S]
u=sorted(t)
if u[0]=='a' and u[1]=='b' and u[2]=='c':
    print('Yes')
else:
    print('No')
Problem:
In programming languages like C/C++, a goto statement provides an unconditional jump from the "goto" to a labeled statement. For example, a statement "goto CHECK_NUM;" is executed, control of the program jumps to CHECK_NUM. Using these constructs, you can implement, for example, loops.  Note that use of goto statement is highly discouraged, because it is difficult to trace the control flow of a program which includes goto.  Write a program which does precisely the same thing as the following program (this example is wrtten in C++). Let's try to write the program without goto statements.                 void call(int n){   int i = 1;  CHECK_NUM:   int x = i;   if ( x % 3 == 0 ){     cout << " " << i;     goto END_CHECK_NUM;   }  INCLUDE3:   if ( x % 10 == 3 ){     cout << " " << i;     goto END_CHECK_NUM;   }   x /= 10;   if ( x ) goto INCLUDE3;  END_CHECK_NUM:   if ( ++i <= n ) goto CHECK_NUM;    cout << endl; }

Incorrect submission (verdict: Wrong Answer):
num = int(input().rstrip())

for i in range(1,num+1):
    if i % 3 == 0 or '3' in str(i):
        print(i)
    
    


Fixed, accepted submission:
n=int(input())
d=[]
for i in range(3,n+1):
    if i%3==0 or "3" in str(i):
        d.append(i)
print(' ',end="")
print(*d)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
A = 1000 - N
print(A)

Fixed, accepted submission:
N = input()
if len(N) >= 3:
    A = int(N[-3])*100 + int(N[-2])*10 + int(N[-1])
    if A == 0:
        print(0)
    else:
        print(1000 - A)
elif len(N) == 2:
    A = int(N[-2])*10 + int(N[-1])
    print(1000 - A)
elif len(N) == 1:
    A = int(N[-1])
    print(1000 - A)
Problem:
Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:                 for i = 1 to A.length-1     key = A[i]     /* insert A[i] into the sorted sequence A[0,...,j-1] */     j = i - 1     while j >= 0 and A[j] > key         A[j+1] = A[j]         j--     A[j+1] = key   Note that, indices for array elements are based on 0-origin.  To illustrate the algorithms, your program should trace intermediate result for each step.

Incorrect submission (verdict: Wrong Answer):
n = input()
A = [int(i) for i in input().split(' ')]

for i in range(1, len(A)):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j+1] = A[j]
        j -= 1
    A[j+1] = v
    [print(i, end=' ') for i in A]
    print()

Fixed, accepted submission:
n = input()
A = [int(i) for i in input().split(' ')]

def trace(A):
    for index, v in enumerate(A):
        print(v, end='')
        if index != len(A) - 1:
            print(' ', end='')
    print()

trace(A)
# algorithm



#     while j >= 0 and A[j] > v:
#         A[j+1] = A[j]
#         j -= 1
#     A[j+1] = v
#     trace(A)

for index, value in enumerate(A):
    if index == 0:
        continue

    prev_idx = index - 1
    while prev_idx >= 0 and A[prev_idx] > value:
        A[prev_idx + 1] = A[prev_idx]
        prev_idx -= 1
    A[prev_idx + 1] = value
    trace(A)
Problem:
You are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits "1974".

Incorrect submission (verdict: Wrong Answer):
n = input().split()
print('Yes' if ('1' in n) and ('9' in n) and ('7' in n) and ('4' in n) else 'No')


Fixed, accepted submission:
n = input().split()
print('YES' if ('1' in n) and ('9' in n) and ('7' in n) and ('4' in n) else 'NO')
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
A, B, X = map(int, input().split())
if A <= X and A+B >= X:
    print('Yes')
else:
    print(('No'))

Fixed, accepted submission:
A, B, X = map(int, input().split())
if A <= X and A+B >= X:
    print('YES')
else:
    print('NO')
Problem:
Snuke has a favorite restaurant.  The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer.  So far, Snuke has ordered N meals at the restaurant. Let the amount of money Snuke has paid to the restaurant be x yen, and let the amount of money the restaurant has paid back to Snuke be y yen. Find x-y.

Incorrect submission (verdict: Wrong Answer):
n = int(input())

if n >= n % 15 == 0:
    x = n * 800
    y = 200 * n / 15
    answer = x - y
    print(answer)
else:
    answer = n * 800
    print(answer)

Fixed, accepted submission:
n = int(input())

if n >= 15:
    print(800 * n - ( n // 15) * 200)
else:
    print(800 * n )
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
A, B, X = [int(i) for i in input().split()]

if A <= X <= A + B:
    print("Yes")
else:
    print("No")

Fixed, accepted submission:
A, B, X = [int(i) for i in input().split()]

if A <= X <= A + B:
    print("YES")
else:
    print("NO")
Problem:
Snuke lives at position x on a number line. On this line, there are two stores A and B, respectively at position a and b, that offer food for delivery.  Snuke decided to get food delivery from the closer of stores A and B. Find out which store is closer to Snuke's residence.  Here, the distance between two points s and t on a number line is represented by |s-t|.

Incorrect submission (verdict: Wrong Answer):
x,a,b = map(int,input().split())
print(min(abs(x-a),abs(x-b)))

Fixed, accepted submission:
x,a,b = map(int,input().split())
print("A" if abs(x-a)<abs(x-b) else "B")
Problem:
Given is a rooted tree with N vertices numbered 1 to N. The root is Vertex 1, and the i-th edge (1 \leq i \leq N - 1) connects Vertex a_i and b_i.  Each of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.  Now, the following Q operations will be performed:    * Operation j (1 \leq j \leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.  Find the value of the counter on each vertex after all operations.

Incorrect submission (verdict: Wrong Answer):
n,q = map(int,input().split())
v = [[0,0] for i in range(n+1)]
for i in range(n-1):
    a,b = map(int,input().split())
    v[a].append(b)
for i in range(q):
    p,x = map(int,input().split())
    v[p][1] += x
q = [1]
while q:
    now = q.pop()
    # print(now)
    for i in v[now][2:]:
        v[i][1] += v[now][1]
    q += v[now][2:]
    # print(q)
print(v)
s = []
for i in v:
    s.append(i[1])
print(*s[1:])

Fixed, accepted submission:
from collections import deque
n,q = map(int,input().split())
v = [[0,0] for i in range(n+1)]
# print(v)
for i in range(n-1):
    a,b = map(int,input().split())
    v[a].append(b)
    v[b].append(a)
for i in range(q):
    p,x = map(int,input().split())
    v[p][1] += x
que = deque([1])
# print(v)
v[1][0] = 1
while que:
    temp = que.popleft()
    for i in v[temp][2:]:
        if v[i][0] == 0:
            v[i][0] = 1
            que.append(i)
            v[i][1] += v[temp][1]
# print(v)
ans = []
for i in v[1:]:
    ans.append(i[1])
    # print(i[1])
print(*ans)
Problem:
Takahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.  The bank pays an annual interest rate of 1 % compounded annually. (A fraction of less than one yen is discarded.)  Assuming that nothing other than the interest affects Takahashi's balance, in how many years does the balance reach X yen or above for the first time?

Incorrect submission (verdict: Wrong Answer):
X = int(input())
k = 0
res = 100
for i in range (1, 4200):
  res = int(res * 1.01)
  if res > X:
    k = i
    break
print(k)

Fixed, accepted submission:
X = int(input())
k = 0
res = 100
for i in range (1, 4200):
  res += res // 100
  if res >= X:
    k = i
    break
print(k)
Problem:
In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year.   For example, May 3, 2018 is written as 2018-5-3, or 5-3 without the year.  In this country, a date is called _Takahashi_ when the month and the day are equal as numbers. For example, 5-5 is Takahashi.   How many days from 2018-1-1 through 2018-a-b are Takahashi?

Incorrect submission (verdict: Wrong Answer):
a , b = input().split()
a = int(a)
b = int(b)
print(a,b)
if b > a:
    print(a+1)
else:
    print(a)

Fixed, accepted submission:
a , b = input().split()
a = int(a)
b = int(b)
if b >= a:
    print(a)
else:
    print(a-1)
Problem:
Niwango created a playlist of N songs. The title and the duration of the i-th song are s_i and t_i seconds, respectively. It is guaranteed that s_1,\ldots,s_N are all distinct.  Niwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.) However, he fell asleep during his work, and he woke up after all the songs were played. According to his record, it turned out that he fell asleep at the very end of the song titled X.  Find the duration of time when some song was played while Niwango was asleep.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
i = 0
songs = []
while N-i:
  songs.append(input().split())
  i+=1
X = input()

Fixed, accepted submission:
N = int(input())

songs = []
result = 0

for i in range(N):
    songs.append(input().split())

X = input()
point = len(songs)

for j in range(N):
    if songs[j][0] == X:
        point = j+1
        break

for i in range(point, N):
    result += int(songs[i][1])


print(result)
Problem:
We will buy a product for N yen (the currency of Japan) at a shop.  If we use only 1000-yen bills to pay the price, how much change will we receive?  Assume we use the minimum number of bills required.

Incorrect submission (verdict: Wrong Answer):
N = int(input())

print(1000 - 1000 % N)

Fixed, accepted submission:
n = int(input())

print(1000 - n % 1000 if n % 1000 > 0 else 0)
Problem:
You are given a string S consisting of lowercase English letters. Another string T is initially empty. Determine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:    * Append one of the following at the end of T: `dream`, `dreamer`, `erase` and `eraser`.

Incorrect submission (verdict: Wrong Answer):
S = input()
S = S[::-1]
_ = ["dream", "dreamer", "erase", "eraser"]
_ = [_[i][::-1] for i in range(4)]
i = 0
while i < len(S):
    can = False
    for k in _:
        if S[i:i + len(k)] == k:
            can = True
            i += len(k)
    if not can:
        print("No")
        exit()
print("Yes")

Fixed, accepted submission:
S = input()
S = S[::-1]
_ = ["dream", "dreamer", "erase", "eraser"]
_ = [_[i][::-1] for i in range(4)]
i = 0
while i < len(S):
    can = False
    for k in _:
        if S[i:i + len(k)] == k:
            can = True
            i += len(k)
    if not can:
        print("NO")
        exit()
print("YES")
Problem:
Sitting in a station waiting room, Joisino is gazing at her train ticket.  The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).  In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with `+` or `-` so that the formula holds.  The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Incorrect submission (verdict: Wrong Answer):
a = input()
c = map(int,list(a))
b = []
for i in c:
    b.append(i)
if(b[0] + b[1] + b[2] + b[3]==7):
    print(a[0]+"+"+a[1]+"+"+a[2]+"+"+a[3]+"=7",end="")
elif(b[0] + b[1] + b[2] - b[3]==7):
    print(a[0]+"+"+a[1]+"+"+a[2],"-"+a[3]+"=7",end="")
elif(b[0] + b[1] - b[2] + b[3]==7):
    print(a[0]+"+"+a[1]+"-"+a[2],"+"+a[3]+"=7",end="")
elif(b[0] + b[1] - b[2] - b[3]==7):
    print(a[0]+"+"+a[1]+"-"+a[2],"-"+a[3]+"=7",end="")
elif(b[0] - b[1] + b[2] + b[3]==7):
    print(a[0]+"-"+a[1]+"+"+a[2],"+"+a[3]+"=7",end="")
elif(b[0] - b[1] + b[2] - b[3]==7):
    print(a[0]+"-"+a[1]+"+"+a[2],"-"+a[3]+"=7",end="")
elif(b[0] - b[1] - b[2] + b[3]==7):
    print(a[0]+"-"+a[1]+"-"+a[2],"+"+a[3]+"=7",end="")
elif(b[0] - b[1] - b[2] - b[3]==7):
    print(a[0]+"-"+a[1]+"-"+a[2],"-"+a[3]+"=7",end="")


Fixed, accepted submission:
a = input()
c = map(int,list(a))
b = []
for i in c:
    b.append(i)
if(b[0] + b[1] + b[2] + b[3]==7):
    print(a[0]+"+"+a[1]+"+"+a[2]+"+"+a[3]+"=7")
elif(b[0] + b[1] + b[2] - b[3]==7):
    print(a[0]+"+"+a[1]+"+"+a[2]+"-"+a[3]+"=7")
elif(b[0] + b[1] - b[2] + b[3]==7):
    print(a[0]+"+"+a[1]+"-"+a[2]+"+"+a[3]+"=7")
elif(b[0] + b[1] - b[2] - b[3]==7):
    print(a[0]+"+"+a[1]+"-"+a[2]+"-"+a[3]+"=7")
elif(b[0] - b[1] + b[2] + b[3]==7):
    print(a[0]+"-"+a[1]+"+"+a[2]+"+"+a[3]+"=7")
elif(b[0] - b[1] + b[2] - b[3]==7):
    print(a[0]+"-"+a[1]+"+"+a[2]+"-"+a[3]+"=7")
elif(b[0] - b[1] - b[2] + b[3]==7):
    print(a[0]+"-"+a[1]+"-"+a[2]+"+"+a[3]+"=7")
elif(b[0] - b[1] - b[2] - b[3]==7):
    print(a[0]+"-"+a[1]+"-"+a[2]+"-"+a[3]+"=7")
Problem:
Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:                 for i = 1 to A.length-1     key = A[i]     /* insert A[i] into the sorted sequence A[0,...,j-1] */     j = i - 1     while j >= 0 and A[j] > key         A[j+1] = A[j]         j--     A[j+1] = key   Note that, indices for array elements are based on 0-origin.  To illustrate the algorithms, your program should trace intermediate result for each step.

Incorrect submission (verdict: Wrong Answer):
def insertionSort(A, N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print (' '.join([str(x) for x in A]))

if __name__ == '__main__':
    length = int(input())
    hoge = [int(x) for x in input().split()]
    insertionSort(hoge, length)


Fixed, accepted submission:
def insertionSort(A, N):
    for i in range(1, N):
        v = A[i]
        j = i - 1
        while j >= 0 and A[j] > v:
            A[j+1] = A[j]
            j -= 1
        A[j+1] = v
        print (' '.join([str(x) for x in A]))

if __name__ == '__main__':
    length = int(input())
    hoge = [int(x) for x in input().split()]
    print (' '.join([str(x) for x in hoge]))
    insertionSort(hoge, length)
Problem:
An integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.  Given an integer N, determine whether it is a Harshad number.

Incorrect submission (verdict: Wrong Answer):
N = input()
print('Yes' if int(N) % sum(map(int, N)) else 'No')

Fixed, accepted submission:
N = input()
print('Yes' if int(N) % sum(map(int, N)) == 0 else 'No')
Problem:
Given a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: `a`, `e`, `i`, `o` and `u`.

Incorrect submission (verdict: Wrong Answer):
list = ["a","b","c","d","e"]
c =input()
if c in list==True:
    print("vowel")
else:
    print("consonant")
    

Fixed, accepted submission:
list = ["a","i","u","e","o"]
c =input()
if c in list:
    print("vowel")
else:
    print("consonant")
Problem:
Square1001 has seen an electric bulletin board displaying the integer 1. He can perform the following operations A and B to change this value:    * Operation A: The displayed value is doubled.   * Operation B: The displayed value increases by K.  Square1001 needs to perform these operations N times in total. Find the minimum possible value displayed in the board after N operations.

Incorrect submission (verdict: Wrong Answer):
N = int(input())
K = int(input())
i = 1
for num in range(N):
  if i < K:
    i *= 2
  else:
    i += K
print (K)

Fixed, accepted submission:
N = int(input())
K = int(input())
i = 1
for num in range(N):
  if i < K:
    i *= 2
  else:
    i += K
print (i)
Problem:
In this problem, a date is written as Y-M-D. For example, 2019-11-30 means November 30, 2019.  Integers M_1, D_1, M_2, and D_2 will be given as input.   It is known that the date 2019-M_2-D_2 follows 2019-M_1-D_1.   Determine whether the date 2019-M_1-D_1 is the last day of a month.

Incorrect submission (verdict: Wrong Answer):
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 != m2:
  print(0)
else:
  print(1)

Fixed, accepted submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 != m2:
  print(1)
else:
  print(0)
Problem:
AtCoDeer the deer found two positive integers, a and b. Determine whether the product of a and b is even or odd.

Incorrect submission (verdict: Wrong Answer):
a, b = map(int, input().split())

moda = a % 2
modb = b % 2

if moda == 0:
    if modb == 0:
        print("Even")
    else:
        print("Odd")
else:
    print("Odd")


Fixed, accepted submission:
a, b = map(int, input().split())

moda = a % 2
modb = b % 2

if moda == 0:
    print("Even")
else:
        if modb == 0:
            print("Even")
        else:
            print("Odd")
Problem:
A string is called a KEYENCE string when it can be changed to `keyence` by removing its contiguous substring (possibly empty) only once.  Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string.

Incorrect submission (verdict: Wrong Answer):
s = input()

if s == 'keyence':
    print('YES')
    exit()

for i in range(0,len(s)-1):
    for j in range(i+1,len(s)):
        print(s[:i]+s[j:])
        if s[:i]+s[j:] == 'keyence':
            print('YES')
            exit()
print('NO')

Fixed, accepted submission:
s = input()

if s == 'keyence':
    print('YES')
    exit()

for i in range(0,len(s)-1):
    for j in range(i+1,len(s)):
        if s[:i]+s[j:] == 'keyence':
            print('YES')
            exit()
print('NO')
Problem:
Print all the integers that satisfies the following in ascending order:    * Among the integers between A and B (inclusive), it is either within the K smallest integers or within the K largest integers.

Incorrect submission (verdict: Wrong Answer):
A, B, K = map(int, input().split())

ans_array = []

for i in range(A, A + K if B > (A + K) else B):
    ans_array.append(i)

for i in range(B, B - K if A < (B - K) else A, -1):
    ans_array.append(i)

ans_array = sorted(list(set(ans_array)))

print(ans_array)


Fixed, accepted submission:
A, B, K = map(int, input().split())

ans_array = []

for i in range(A, A + K if B > (A + K) else (B+1)):
    ans_array.append(i)

for i in range(B, B - K if A < (B - K) else (A-1), -1):
    ans_array.append(i)

ans_array = sorted(list(set(ans_array)))

for i in ans_array:
    print(i)