TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
from collections import deque
import sys

deque_s = deque(list(input()))
kyoto
deque_t = deque(list(input()))
tokyo

for _i in range(len(deque_s)):
    deque_s.rotate()
    if deque_s == deque_t:
        print('Yes')
        sys.exit()

print('No')

from collections import deque
import sys

deque_s = deque(list(input()))
deque_t = deque(list(input()))

for _i in range(len(deque_s)):
    deque_s.rotate()
    if deque_s == deque_t:
        print('Yes')
        sys.exit()

print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print("No")

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]

if s == t:
    print("Yes")
else:
    print("No")


# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print('No')
    break

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]


# -*- coding: utf-8 -*-
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

if slen != tlen:
    print("No")

for i in range(slen):
    if s == t:
        print("Yes")
        break
    s = s[-1] + s[:-1]

if s != t:
    print("No")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

for i in range(len(S)):
    print(S[i:] + S[:i])
    if T == S[i:] + S[:i]:
        print('Yes')
        exit()
print('No')

S = input()
T = input()

for i in range(len(S)):
    if T == S[i:] + S[:i]:
        print('Yes')
        exit()
print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=input()
t=input()
total=False
for i in range(len(s)):
    s=s[len(s)-1]+s[0:len(s)-1]
    print(s)
    if s==t:
        print("Yes")
        total=True
        break
if total==False:
    print("No")

s=input()
t=input()
total=False
for i in range(len(s)):
    s=s[len(s)-1]+s[0:len(s)-1]
    if s==t:
        print("Yes")
        total=True
        break
if total==False:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=list(input())
t=list(input())
for i in range(len(s)):
  x=s.pop(0)
  s.append(x)
  if s==t:
    print("Yes")
    break
  else:
    print("No")

s=list(input())
t=list(input())
for i in range(len(s)):
  x=s.pop(0)
  s.append(x)
  if s==t:
    print("Yes")
    break
else:
  print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=list(input())
t=list(input())
for i in range(len(s)):
  if s==t:
    print("Yes")
    exit()
  s=s[1:].append(s[0])
print("No")


s=input()
t=input()
if s.sort() == t.sort():
  print("Yes")
else:
  print("No")


s=list(input())
t=list(input())
for i in range(len(s)):
  if s==t:
    print("Yes")
    exit()
  s.append(s[0])
  s=s[1:]
print("No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u
  
print('No')

s = input()
t = input()

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u
  
print('No')

s = input()
t = input()

x = len(s)

if s == t:
  print('Yes')

for z in range(x):
  u[0] = s[x-1]
  
  for y in range(x-2):
    u[0] = s[x-1]
    u[y+1] = s[y]
  
  if t == u;
  print('Yes')

  s = u

print('Yes' if (input() * 2).find(input()) != -1 else 'No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

for i in range(len(s)):
    ns = s[i:] + s[:i]
    if(s == t):
        print('Yes')
        exit()
print('No')


s = input()
t = input()

for i in range(len(s)):
    ns = s[i:] + s[:i]
    if(ns == t):
        print('Yes')
        exit()
print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

s = list(S)
ans = 0

if S.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    print(s)
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

S =input()
T = input()

s = list(S)
ans = 0

if B.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    print(s)
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

S =input()
T = input()

s = list(S)
ans = 0

if S.lower() == T.lower():
        ans +=1

for _ in  range(len(s)-1):
    A=s[-1]
    s.pop(-1)
    s.insert(0,A)
    #print(s)
    B=''.join(s)
    if B.lower() == T.lower():
        ans +=1
if ans != 0:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S = input()
T = input()
Flag = True
N = len(S)
for i in range(N):
    if S[i] != T[N - 1 - i]:
        Flag = False
        break

if Flag:
    print('Yes')
else:
    print('No')

S = input()
T = input()
N = len(S)
flag = False

for i in range(N):
    t = S[-1] + S[:-1]
    if t == T:
        flag = True
        break

if flag:
    print('Yes')
else:
    print('No')

S = input()
T = input()
N = len(S)
flag = False

for i in range(N):
    t = S[-1] + S[:-1]
    S = t
    if t == T:
        flag = True
        break

if flag:
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S,T=input().split()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")

s=input()
t=input()
ss=s+s
if t in s:
  print("Yes")
else:
  print("No")

S,T=input().split()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")

s=input()
t=input()
ss=s+s
n=len(s)
for i in range(n):
  if ss[i:]=t:
    print("Yes")
    exit(0)

print("No")


S,T=input.split()
for i in range(len(S)):
  if S[i:]+S[:i]==T:
    print("Yes")
    exit(0)
    
print("No")

s=input()
t=input()
ss=s+s
n=len(s)
for i in range(n):
  if ss[i:]==t:
    print("Yes")
    exit(0)

print("No")


S = input()
T = input()
N = len(S)
for i in range(N):
    if S[i:]+S[:i] == T:
        print("Yes")
        exit(0)
print("No")


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
a = input()
b = input()
for i in range(101):
  if a == b:
    print("Yes")
  a = a[-1]+a[:-2]
else:
  print("No")
  

a = input()
b = input()
for i in range(101):
    if a == b:
        print("Yes")
        break
    a = a[-1]+a[:-1]
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=input()
t=input()
for i in range(len(s)):
    if [:i]+[i:]==t:
        ans=0
    else:
        ans=1
        break
if ans==0:
    print("Yes")
else:
    print("No")

s=input()
t=input()
for i in range(len(s)):
    if s[i:]+s[:i]!=t:
        ans=0
    else:
        ans=1
        break
if ans==1:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
a = input()
b = input()
c = a + a
count = 0
for i in range(len(c) - len(b)):
  if c[i:i+len(b)] == b:
    print("Yes")
    break
    count += 1
if count == 0:
  print("No")

a = input()
b = input()
c = a + a
count = 0
for i in range(len(c) - len(b)):
  if c[i:i+len(b)] == b:
    print("Yes")
    count += 1
    break
if count == 0:
  print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

Z =False

if i in range(len(s)):
    s = s[-1] + s[:-1]
    if s == t:
        Z =True
        exit()
        
print('Yes' if Z else 'No')

s = str(input())
t = str(input())

Z =False

if i in range(lens(s)):
    s = s[-1] + s[:-1]
    if s == t:
        Z =True
        break
        
print('Yes' if Z else 'No')

s = str(input())
t = str(input())
k = False
for i in range(len(s)):
  s = s[-i] + s[:-i]
  if s == t:
    k = True
    break
    
print('Yes' if k else 'No')

s = str(input())
t = str(input())
k = False
for i in range(len(s)):
  s = s[-1] + s[:-1]
  if s == t:
    k = True
    break
    
print('Yes' if k else 'No')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=input()
t=input()
for i in len(s):
  tmp=s[i:]+s[:i]
  if tmp==t:
    print('Yes')
    exit()
print('No')

s=input()
t=input()
for i in range(len(s)):
  tmp=s[i:]+s[:i]
  if tmp==t:
    print('Yes')
    exit()
print('No')

Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

for i in range(len(S) - 1, -1, -1):
    if S[i:] + S[:i] == T:
        print('yes')
        break
else:
    print('no')

S = input()
T = input()

S = S + S
print('Yes') if S.find(T) >= 0 else print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=input()
t=input()
if len(s)!=len(t):
	print("No")
	exit(0)
for i in t:
	if i not in s:
		print("No")
		exit(0)
for i in range(-1,len(s)):
	if s==t:
		print("Yes")
		break
	s=s[-1]+s[:-1]
	print(s)


s=input()
t=input()
for i in t:
	if i not in s:
		print("No")
		exit(0)
for i in range(-3,len(s)):
	if s==t:
		print("Yes")
		exit(0)
	s=s[-1]+s[:-1]
print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j=(j+i)%len(a)
    if a[j]!=b[i]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j=(j+i)%len(a)
    if a[j]!=b[j]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j=(j+i)%len(n)
    if a[j]!=b[j]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

a=input()
b=input()
ans="No"
for i in range(len(a)):
  k=1
  for j in range(len(a)):
    j2=(j+i)%len(a)
    if a[j]!=b[j2]:
      k=0
      break
  if k==1:
    ans="Yes"
    break
    
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
old_str = input()
compare_str = input()
if old_str[::-1] == compare_str:
    print("Yes")
else:
    print("No")





#if WATCH_RUNTIME
	#include <ctime>
	clock_t startTime;
#endif

#include <cstdio>
#include <cstring>

int main(void)
{
	#if DEBUG 
	freopen("_in","r",stdin);
	#endif
	#if WATCH_RUNTIME
	startTime=clock();
	#endif
	bool winFlag;
	int i,j,N;
	char msg[200],patten[100];
	scanf("%s",msg);
	scanf("%s",patten);
	N=strlen(msg);
	for(i=0;i<N;i++)
	{
		msg[N+i]=msg[i];
	}
	msg[N+i]='\0';
	for(i=0;i<N;i++)
	{
		winFlag=true;
		for(j=0;patten[j];j++)
		{
			if(patten[j]!=msg[i+j])
			{
				winFlag=false;
				break;
			}
		}
		if(winFlag)
			break;
	}
	printf("%s\n",winFlag?"Yes":"No");

	#if WATCH_RUNTIME
	printf("----------\n");
	printf("\n+===============+\n");
	printf("|RUNTIME =%3dms.|\n",clock()-startTime);
	printf("+===============+\n");
	#endif

	return 0;
}

S = input()
T = input()

for _ in range(len(S)):
    if S == T:
        print('Yes')
        break
    else:
        S = S[-1] + S[:-1]
else:
    print('No')


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
l = list(map(int,input().split()))
task_list = sorted(l)

print(task_list[2]-task_list[0])

S = input()
T = input()*2

if S in T:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s = list(input())
t = input()
ans = "No"
for i in range(len(s)):
    s.append(s.pop(0))
    print(s)
    if "".join(s)==t:
        ans = "Yes"
print(ans)

s = list(input())
t = input()
ans = "No"
for i in range(len(s)):
    s.append(s.pop(0))
    if "".join(s)==t:
        ans = "Yes"
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

ans = "No"
for i in range(len(S)):
	if S[:i] + S[0:i] == T:
		ans = "Yes"

print(ans)

ans = "No"
for i in range(len(S)):
	if S[:i] + S[0:i] == T:
		ans = "Yes"

print(ans)

S=input()
T=input()

ans = "No"
for i in range(len(S)):
	if S[:i] + S[0:1] == T:
		ans = "Yes"

print(ans)


S=input()
T=input()

ans = "No"
for i in range(len(S)):
	if S[i:] + S[0:i] == T:
		ans = "Yes"

print(ans)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=list(input())
t=list(input())
ans="NO"
for i in range(len(s)):
    if s==t:
        ans="YES"
        break
    temp=s.pop()
    s.insert(0,temp)
print(ans)

s=list(input())
t=list(input())
ans="No"
for i in range(len(s)):
    if s==t:
        ans="Yes"
        break
    temp=s.pop()
    s.insert(0,temp)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
import sys

l = list(input())
s = list(input())

for i in range(len(l)):
    if l == s:
        print("Yes")
        sys.exit(0)
    l = l[1:]+list(l[0])
    print(l)
print("No")


import sys

l = list(input())
s = list(input())

for i in range(len(l)):
    if l == s:
        print("Yes")
        sys.exit(0)
    l = l[1:]+list(l[0])
print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

st = False
for i in range(0,len(s)-1):
    s = s[-1]+s[0:len(s)-1]
    if s==t:
        st = True
        print("yes")
        break
if not st:
    print("No")

s = str(input())
t = str(input())

st = False
for i in range(0,len(s)-1):
    print(s)
    s = s[-1]+s[0:len(s)-1]
    print(s)
    if s==t:
        st = True
        print("Yes")
        break
if not st:
    print("No")

s = str(input())
t = str(input())

st = False
for i in range(0,len(s)):
    s = s[-1]+s[0:len(s)-1]
    if s==t:
        st = True
        print("Yes")
        break
if not st:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

for i in range(len(s)):
    s = s[-1] + s[:-1]
    print(s, t)
    if s == t:
        print("Yes")
        break
else:
    print("No")


s = input()
t = input()

for i in range(len(s)):
    s = s[-1] + s[:-1]
    if s == t:
        print("Yes")
        break
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):


s = input()
test = input()

for i in range(len(s)):
    s_right = s[i:]
    s_left = s[:i]

    s_rot = s_right + s_left
    
    print(s_rot)

    if s_rot == test:
        print("Yes")
        break
else:
    print("No")



s = input()
test = input()

for i in range(len(s)):
    s_right = s[i:]
    s_left = s[:i]

    s_rot = s_right + s_left
    
    #print(s_rot)

    if s_rot == test:
        print("Yes")
        break
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s = input()
t = input()
if s== t[::-1]:
  print('Yes')
else:
  print('No')


s = input()
t = input()

ans = 'No'
for i in range(len(t)):
  if s == t[i:]+t[:i]:
    ans = 'Yes'
    break
print(ans)    

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    if(s1[i:]+s1[:i-1] == s2):
        print("Yes")
        break
else:
    print("No")

s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    print(s1[i:]+s1[:i],s2)
    if(s1[i:]+s1[:i] == s2):
        print("Yes")
        break
else:
    print("No")

s1,s2 =input(),input()
for i in range(len(s1)):
    if(i==0):
        if(s1==s2):
            print("Yes")
            break
    if(s1[i:]+s1[:i] == s2):
        print("Yes")
        break
else:
    print("No")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s1 = list(input())

s2 = list(input())

ans = 'No'

for i in range(len(s1)-1):
  print(s1)
  if (s1 == s2):
    ans = 'Yes'
    break
  last = s1.pop()
  s1.insert(0,last)
print(ans)
  

s1 = list(input())

s2 = list(input())

ans = 'No'

for i in range(len(s1)):
  if ("".join(s1) == "".join(s2)):
    ans = 'Yes'
    break  
  last = s1.pop()
  s1.insert(0,last)
print(ans)
  

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=list(input())
t=input()
for i in range(len(s)):
    s.insert(0,s.pop())
    word="".join(s)
    if s==t:
        print("Yes")
        exit()
print("No")

s=list(input())
t=input()
for i in range(len(s)):
    s.insert(0,s.pop(-1))
    word="".join(s)
    if s==t:
        print("Yes")
        exit()
print("No")

from collections import deque
s=list(input())
s=deque(s)
t=input()
for i in range(len(s)):
    s.appendleft(s.popleft())
    if t=="".join(s):
        print("Yes")
        exit()
print("No")

s=list(input())
t=input()
for i in range(len(s)):
    s.insert(0,s.pop())
    word="".join(s)
    if word==t:
        print("Yes")
        exit()
print("No")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=input()
t=input()
for i in range(len(s)+1):
  if s == t:
    print("Yes")
    break
  else:
    k = s[0]
    for i in range(len(s)-1):
      s[i]=s[i+1]
    s[-1] = k
else:
  print("No")

s=list(input())
t=list(input())
for i in range(len(s)+1):
  if s == t:
    print("Yes")
    break
  else:
    k = s[0]
    for i in range(len(s)-1):
      s[i]=s[i+1]
    s[-1] = k
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=list(input())
t=list(input())
ans='No'
for i in range(len(s)+1):
    if s==t:
        ans='Yes'
        break
    s.insert(0,s.pop())
    print(s)
print(ans)

s=list(input())
t=list(input())
ans='No'
for i in range(len(s)+1):
    if s==t:
        ans='Yes'
        break
    s.insert(0,s.pop())
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s = list(input())
t = list(input())
for i in range(s):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
print("No")

s = input()
t = input()
for i in range(len(s)):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
print("No")

s = input()
t = input()
for i in range(s):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
print("No")

s = list(input())
t = list(input())
for i in range(len(s)):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
print("No")

s = list(input())
t = list(input())
for i in range(len(s)):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
print("No")

s = list(input())
t = list(input())
for i in range(len(s)):
    s.insert(0, s.pop(-1))
    if s == t:
        print("Yes")
        exit()
print("No")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S = input()
if S[0] != 'A':
    print('WA')
    exit()
a=0
for i in range(2, len(S) - 1):
    if S[i]=='C':
        j=i
        a+=1
if a!=1:
    print('WA')
    exit()
for i in range(len(S)):
    if (i!=0)&(i!=j):
        a=S[i]
        if a.isupper():
            print('WA')
            exit()
print('AC')

s=input()
t=input()
for i in range(len(s)):
    s=s[1:len(s)]+s[0]
    print(s)
    if s==t:
        print('Yes')
        exit()
print('No')

s=input()
t=input()
for i in range(len(s)):
    s=s[1:len(s)]+s[0]
    if s==t:
        print('Yes')
        exit()
print('No')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S = input()
T = input()
word = [x for x in T]
for i in range(len(word)):
    a = word[0]
    word.append(a)
    word.remove(a)
    if S == word:
        break
    else:
        pass
if S == word:
    print('Yes')
else:
    print('No')

S = input()
T = input()
word = [x for x in T]
for i in range(len(word)):
    a = word[0]
    word.append(a)
    word.remove(a)
    if S == ''.join(word):
        break
    else:
        pass
if S == ''.join(word):
    print('Yes')
else:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

s = input()
t = input()
ans=0
for i in range(0,len(s)):
    a=s[i:]
    b=s[:i]
    ss=a+b
    #print(ss)
    if ss == t:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s = input()
t = input()
flag = False
for i in range(len(i)):
  if s == t:
    flag = True
    break
  s = s[1:] + s[0]
print("Yes" if flag else "No")


s = input()
t = input()
flag = False
for i in range(len(s)):
  if s == t:
    flag = True
    break
  s = s[1:] + s[0]
print("Yes" if flag else "No")


Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s=input()
t=input()
ans=0
for i in range(len(s)):
    if t[i:]+t[:i]==s:
        ans=1
        break
print("Yes" if ans else "No")
print(ans)

s=input()
t=input()
ans=0
for i in range(len(s)):
    if t[i:]+t[:i]==s:
        ans=1
        break
print("Yes" if ans else "No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):

S=list(input())
T=input()


S.reverse()


S=''.join(S)

if S==T:
  print('Yes')
else:
  print('No')


S=input()
T=input()

for i in range(len(S)):
  
  S=S[-1]+S[:-1]

  
  if S==T:
    print('Yes')
    exit()


print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

for i in range(1, len(S)):
    print(S[-i:] + S[:-i])
    if S[-i:] + S[:-i] == T:
        print('Yes')
        exit()
print('No')

S = input()
T = input()

for i in range(len(S)):
    if S[-i:] + S[:-i] == T:
        print('Yes')
        exit()
print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
a=list(input())
b=list(input())
a=a+a

if len(a)!=len(b):
  print("No")
else:
    for i in range(len(b)):
        if b==a[i:i+len(b)]:
            print("Yes")
            break
        if i==len(b)-1:
            print("No")

a=list(input())
b=list(input())
a=a+a

if len(a)/2!=len(b):
  print("No")
else:
    for i in range(len(b)):
        if b==a[i:i+len(b)]:
            print("Yes")
            break
        if i==len(b)-1:
            print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S = input()
T = input()
ans = 'No'
for i in range(len(S)):
  if S[i:]+S[i] == T:
    ans = 'Yes'
    break
print(ans)

S = input()
T = input()
ans = 'No'
for i in range(len(S)):
  if S[i:]+S[:i] == T:
    ans = 'Yes'
    break
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
s = input().strip()
t = input().strip()
print ("Yes" if any(s[i:] + s[:i]  == t for i in range(len(s)) else "No")

s = input().strip()
t = input().strip()
print ("Yes" if any(s[i:] + s[:i]  == t for i in range(len(s))) else "No")

Verdicts: Runtime Error

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S=input()
T=input()
T+=T
if S in T:
  print('Yse')
else:
  print('No')

S=input()
T=input()
S+=S
if T in S:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S = list(input())
T = list(input())
n = len(S)
if S == T :
    print('Yes')
else :
    for i in range(n-1) :
        a = S[n-1]
        S[1:n] = S[0:n-1]
        S[0] = a
        if S == T :
            print('Yes')
    else :
        print('No')

S = list(input())
T = list(input())
n = len(S)
if S == T :
    print('Yes')
else :
    for i in range(n-1) :
        a = S[n-1]
        S[1:n] = S[0:n-1]
        S[0] = a
        if S == T :
            print('Yes')
            break
    else :
        print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
import sys

S = input()
T = input()

Sc = list(S)
Tc = list(T)

Sl = len(Sc)
newSc = Sc

for i in range(Sl):
    newSc = newSc[(Sl - 1):] + newSc[:(Sl - 1)]
    if Tc == newSc:
        print('yes')
        sys.exit()

print('No')


import sys

S = input()
T = input()

Sc = list(S)
Tc = list(T)

Sl = len(Sc)
newSc = Sc

for i in range(Sl):
    newSc = newSc[(Sl - 1):] + newSc[:(Sl - 1)]
    if Tc == newSc:
        print('Yes')
        sys.exit()

print('No')


Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

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

for i in range(len(s)):
    if s == t:
        print('Yes')
        break
    else:
        s_last = s[-1]
        s = s_last + s[0:len(s)-1]
        print(s)
if s != t:
    print('No')

s = input()
t = input()
 
for i in range(len(s)):
    if s == t:
        print('Yes')
        break
    else:
        s_last = s[-1]
        s = s_last + s[0:len(s)-1]
if s != t:
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
import sys

S = input()
T = input()

for i in range(len(S)):
  s = S[i:] + S[:i]
  if S == T:
    print('Yes')
    sys.exit()
    
print('No')

import sys
 
S = input()
T = input()
 
for i in range(len(S)):
  s = S[i:] + S[:i]
  if s == T:
    print('Yes')
    sys.exit()
    
print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given string S and T consisting of lowercase English letters.  Determine if S equals T after _rotation_.  That is, determine if S equals T after the following operation is performed some number of times:  Operation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.  Here, |X| denotes the length of the string X.

Submission attempts (in order):
S = input()
T = input()
flag = False
for i in range(len(S)+1):
    print(S)
    if(S==T):
        print("Yes")
        flag = True
    S = S[-1:] + S[:-1]
if flag == False:
    print("No")


S = input()
T = input()
sc = S
flag = False
for i in range(len(sc)):
    if(sc==T and flag==False):
        print("Yes")
        flag = True
    tmp1 = sc[-1:]
    tmp2 = sc[:-1]
    # print(tmp1)
    # print(tmp2)
    sc = tmp1 + tmp2
if flag == False:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
import numpy as np
n = int(input())
A = list(map(int, input().split()))

print(A)
lcm = np.lcm.reduce(A)
ans = ((lcm - 1) % A).sum()
print(ans)


import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))

ans = (A-1).sum()
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
import math

def lcm(a,b):
  return a//math.gcd(a,b)*b

n = int(input())
v = [int(x) for x in input().split()]
running = 1
for x in v:
  running = lcm(running,x)
print(x-1)

def gcd(a,b):
  while b:
    a, b = b,a%b
  return x

def lcm(a,b):
  return a//gcd(a,b)*b

n = int(input())
v = [int(x) for x in input().split()]
running = 1
for x in v:
  running = lcm(running,x)
print(x-1)


n = int(input())
v = [int(x) for x in input().split()]
running = 0
for x in v:
  running += x-1
print(running)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
from fractions import gcd
def lcm(x,y):
  return int(x*y/gcd(x,y))
n=int(input())
a=list(map(int,input().split()))
for i in range(1,len(a)):
  if i==1:g=lcm(a[0],a[1])
  else:g=lcm(g,a[i])
c=0
for j in range(len(a)):
  c+=(g-1)%a[j]
print(c)

print(-int(input())+sum(map(int,input().split())))

Verdicts: Runtime Error

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
a = input(int())
l = list(map(int, input().split()))
k = sum(l)-len(l)
print(int(k))

a = input()
l = list(map(int, input().split()))
print(sum(l)-len(l))

Verdicts: Wrong Answer

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
a  = input()
 
ans = 0
a = [int(i) for i in input().split()]
 
for num in a:
  ans += num - 1
  
 print(ans)

input()

ans = 0
a = [int(i) for i in input().split()]

for num in a:
  ans += num - 1
  
 print(ans)

a  = input()
 
ans = 0
a = [int(i) for i in input().split()]
 
for num in a:
  ans += num - 1
  
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
import fractions


def main():
    n = int(input())
    a = list(map(int, input().split()))

    lcm_temp = 1

    for i in range(n):
        if(a[i] != 0):
            lcm_temp = lcm(lcm_temp, a[i])

    print(lcm_temp-1)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a*b // gcd(a, b)


if __name__ == '__main__':
    main()


import fractions


def main():
    n = int(input())
    a = list(map(int, input().split()))

    lcm_temp = 1

    for i in range(n):
        lcm_temp = lcm(lcm_temp, a[i])

    lcm_temp -= 1

    sum = 0
    for i in a:
        sum += lcm_temp % i
    print(sum)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a*b // gcd(a, b)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: You are given N positive integers a_1, a_2, ..., a_N.  For a non-negative integer m, let f(m) = (m\ mod\ a_1) + (m\ mod\ a_2) + ... + (m\ mod\ a_N).  Here, X\ mod\ Y denotes the remainder of the division of X by Y.  Find the maximum value of f.

Submission attempts (in order):
n=int(input())
da=list(map((int,input().split()))
ans=0
for i in da:
  ans+=i-1
print(ans)


n=int(input())
da=list(map((int,input().split()))
ans=0
fro i in range da:
  ans+=i-1
print(ans)

n=int(input())
da=list(map(int,input().split()))
ans=0
for i in da:
  ans+=i-1
print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted