TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

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

if n == 1:
    print('使える文字が 1種類しか無い場合、パスワードは1種類しか設定出来ません。')
else:
    msg = "設定出来るパスワードは"
    array = []
    for x in range(1, n + 1) :
        for y in range(1, n + 1):
            for z in range(1, n + 1):
                array.append("\'" + str(x) + str(y) + str(z) + "\'")
    
    print("設定出来るパスワードは" + ','.join([str(i) for i in array]) + 'の' + str(n ** 3) + '種類です。')

n=input()
print(int(n)*int(n)*int(n))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

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

ans =  (n-1)**3

n = int(input())
print(n**3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n=int(input())
print(n***3)

n=int(input())
print(n**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
s=int(input())
print(s^3)

s=int(input())
print(s**3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n=int(input())
print(n*(n-1)*(n-2))

n=int(input())
print(n**3)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
print(int(input)**3)

print(int(input())**3)


Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
var=n;

cin>>n;

print(n*n*n)

n = int(input())

print(n*n*n)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
# -*- coding: utf-8 -*-
 
N = int(input())
c = 0
 
print(N*3)

# -*- coding: utf-8 -*-

N = int(input())
c = 0

print({}.format(N*3))

# -*- coding: utf-8 -*-

N = int(input())

print(N*N*N)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
print (N**2)

N = int(input())
print (N**3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
print(II()**3)


import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

print(II()**3)


Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n=int(input())
print(n**n)

n=int(input())
print(n**2)

print(int(input())**3)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
import math
def cmb(n,r):
  return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))
n=int(input())
a=list(map(int,input().split()))
a.sort()
ls=[0]
cnt=0
for i in range(1,2**n):
  if a[i]>a[i-1]:
    cnt+=1
  ls.append(cnt)
lmt = []
for i in range(n+1):
  lmt.extend([i]*cmb(n,i))
bias = ls[-1]-lmt[-1]
jdg = 0
ulmt = 0
for i in range(n):
  jdg += ls.count(i)
  ulmt += 2**(n-i-1)
  if jdg > ulmt:
    print("No")
    exit()
for x,l in zip(ls,lmt):
  if x-l > bias:
    print("No")
    break
else:
  print("Yes")

print(int(input())**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
print(str(int(input())^^3))

N = int(input())
print(str(N ** 3))

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

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

print(n ** 3)

n = int(input())

print(n ** 3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n = int(input("Number between 1 and 9"))
print(str(n*n*n))

import itertools

n = int(input("Input N"))
x = []
for i in range(0, n):
  x.append(i)
print(str(itertools.permutations(x)))

n = int(input())
x = n*n*n
print(x)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n=int(input())
print(n^3)

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
M=0
for i in range(N):
    A[i]-=1
for i in range(N-1):
    if A[i]+1==A[i+1]:
        M+=B[A[i]]+C[A[i]]
    else:
        M+=B[A[i]]
print(M+B[A[N-1]])

N=int(input())
print(N*N*N)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = input()
print(N*N*N)

N = int(input())
print(N*N*N)


Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
s = int(input())
print s

s = int(input())
print(pow(s,3))

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
main():
  n = int(input())
  print(n**3)

if __name__ == '__main__':
  main()

def main():
  n = int(input())
  print(n**3)

if __name__ == '__main__':
  main()

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n=int(input())
print(n**3))

print(int(input())**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
print(int(input())**2)

print(int(input())**3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

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


n=int(input())
print(n**3)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
#input
N = int(input())
B = list(map(int, input().split()))

A = [0] * N
for i in range(1, N-1):
    if A[i] > B[i]:
        A[i] = B[i]
    A[i+1] = B[i]

print(sum(A))

#input
N = int(input())

print(N ** 3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n=int(input("the number you can use",":"))
if n>10:
  break
  else:
    print(n**3)

n=int(input("Number"))
print(n**3)



n=int(input("Number"))
if n<=9:
    print(n**3)




n=input("Number")
if type(n)!=int:
  break
else:
  if n>10:
    break
  else:
    print(n**3)


n=int(input("the number you can use",":"))

print(n**3)

a=input("the number you can")
if type(a)==int:
  if a<=9:
    print(a**3)

N=int(input())
print(N**3)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
int(input())*3

i = int(input())
print(i**3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
print(2**N)


N = int(input())
print(N**3)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
print(input()**3)

print(int(input())**3)


Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
x = input()
if x == 1:
  print(″1″)
else:
  print(int(x) * int(x) * int(x))

n = input()
result = 0
if n == 1:
    print(1)
else:
    result = int(n) * int(n) * int(n)
    print(result)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

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

print(x*x*x)

x = int(input())

print(x*x*x)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n,m=map(int, input().split())
s=list(input())
count=0
x=0
y=0
s=['R']+s+['L']

for i in range(1,n+1):
    if s[i]=='L':
        if s[i-1]==s[i]:
            count+=1
    else:
        if s[i]==s[i+1]:
            count+=1
       
for i in range(1,n+1):
    if s[1]=='L':
        if s[i-1]=='R' and s[i]=='L':
            if i==1:
                x+=1
            else:
                y+=1

    else:
        if s[i]=='R' and s[i+1]=='L':
            if i==n:
                x+=1
            else:
                y+=1
if m<y:
    print(count+2*m)
elif m==y:
    print(count+y*2-1)
else:
    print(count+y*2-1+x)
    


        
        
    
    
        



n=int(input())
print(n**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
a=input()
print(a**3)

s=input()
ans=1
for i in range(3):
	ans*=s
print(ans)


a = input()
print(a**3)


s=input()
ans=1
for i in range(3)
	ans*=s
print(ans)

a=int(input())
print(a**3)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
k = int(input())
print(k**k)

k = int(input())
print(k**k

k = int(input())
print(2**k)

k = int(input())
print(k**3)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
la=input().split()
lb=input().split()
lc=input().split()

lc = lc+['0']
#print(lc)

total=0
for i in range(N):
    total = total+int(lb[i])+int(lc[i])
#print(total)

k = int(la[N-1])
#print(k)

print(total-int(lc[k-1]))


N = int(input())
la=input().split()
lb=input().split()
lc=input().split()

lc = lc+['0']
#print(lc)

total=0
for i in range(N-1):
    total =total+int(lb[i])+int(lc[i])

print(total-int(lc[int(la[N-1])]))


N = int(input())
la=input().split()
lb=input().split()
lc=input().split()

lc = lc+['0']
#print(lc)

total=0
for i in range(N):
    total = total+int(lb[i])+int(lc[i])
#print(total)

k = int(la[N-1])
#print(k)

print(total-int(lc[k-1]))


N = int(input())

print(N**3)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
print(2**N)


print(3 ** int(input()))

print(int(input() ** 3))

print(int(input()) ** 3)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

score = 0
for i in range(0,N-1):
    if A[i+1] - A[i] == 1:
        score += C[A[i] - 1]

print(score + sum(B))

N = int(input())
print(N**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
from sys import stdin
from math import factorial

n = int(stdin.readline().rstrip().split())

print(n**3)

from sys import stdin
from math import factorial
n = int(stdin.readline().rstrip())
print(n**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n = int(input())
n ** 3


n = int(input())
x = n ** 3
print(x)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
n = int(input())
s = 0
for i in range(n+1):
  for j in range(n+1):
    for m in range(n+1):
      s += 1

print(s)
      
  

n = int(input())
print(n**3)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
s = [input().split() for i in range(3)]

A = [int(i) for i in s[0]]
B = [int(i) for i in s[1]]
C = [int(i) for i in s[2]]

sum1 = sum(B)

for i in range(N-1):
 if (A[i]+1) == A[i+1]:
     sum1 += C[A[i]-1]

print(sum1)

N = int(input())

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

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

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

sum1 = sum(s1)

for i in range(N):
  if (s0[i]+1) == s0[i+1]:
    sum1 += s2[s0[i]-1]
  else :
    sum1=sum1

print(sum1)

n = int(input())
print(n*n*n)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
B = list(map(int, input().split()))

A = [0] * N

for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = B[0]
A[N-1] = B[N-2]

print(sum(A))

N = int(input())
B = list(map(int, input().split()))

A = [0] * N


for i in range(N-1):
  A[i] = min(B[i-1],B[i])

A[0] = min(B[0],B[1])
A[N-1] = B[N-2]

print(sum(A))

n = int(input())

ans = n ** 3

print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = sum(B)

now = 0
for i in A:
  pre = now
  now = i
  if now == (pre+1):
    ans += C[pre-1]
print(ans)

N = int(input())

anc = N**3
print(anc)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):
e=int(input())
sum=1
for i in e:
  sum*=i**e
print(sum)

print(int(input())**3)

Verdicts: Runtime Error

Accepted
Problem: Takahashi is going to set a 3-character password.  How many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?

Submission attempts (in order):

# -*- coding: utf-8 -*-

pass_clm = int(input())
print((pass_clm - 1) ** 3)


# -*- coding: utf-8 -*-

print(int(input()) ** 3)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ans=0

for x,y in zip(a,a[1:]):
  if y == x+1:
    ans += c[x-1]
    
print(sum(y)+ans)

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

ans=0

for x,y in zip(a,a[1:]):
  if y == x+1:
    ans += c[x-1]
    
print(sum(b)+ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
s=0
for i in range(N):
  s+=B[A[i]-1]
  if i!=0 and A[i-1]+1==A[i]:
    s+=C[i]
print(s)

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
s=0
for i in range(N):
  s+=B[A[i]-1]
  if i!=0 and A[i-1]+1==A[i]:
    s+=C[A[i]-2]
print(s)

Verdicts: Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
print(A[0])
ans=B[int(A[0])-1]

for i in range(1,n):
    if A[i-1]+1==A[i]:
        ans += B[int(A[i])-1]+C[int(A[i-1])-1]
    else:
        ans += B[int(A[i]-1)]
       
print(ans)

n = int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))

ans=B[int(A[0])-1]

for i in range(1,n):
    if A[i-1]+1==A[i]:
        ans += B[int(A[i])-1]+C[int(A[i-1])-1]
    else:
        ans += B[int(A[i])-1]
       
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

answer = sum(B)
for i in range(N-1):
    if A[i+1] - A[i] == 1:
        answer += C[i]

print(answer)


N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

answer = sum(B)
for i in range(N-1):
    if A[i+1] - A[i] == 1:
        answer += C[A[i]-1]

print(answer)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = input()
array_A = list(map(int, input().split()))
array_B = list(map(int, input().split()))
array_C = list(map(int, input().split()))

#print(N)
#print(array_A)

#print(array_C)

bonus = []
for i in range(len(array_A)-1):
  if array_A[i] + 1 == array_A[i+1]:
    bonus += [i]

#print(bonus)

bonus_point = 0
for i in (bonus):
  bonus_point += array_C[i]

#print(bonus_point)  
score = sum(array_B) + bonus_point
print(score)

N = input()
array_A = list(map(int, input().split()))
array_B = list(map(int, input().split()))
array_C = list(map(int, input().split()))

print(sum(array_B))

N = input()
array_A = list(map(int, input().split()))
array_B = list(map(int, input().split()))
array_C = list(map(int, input().split()))

bonus_position = []
for i in range(len(array_A)-1):
  if array_A[i] + 1 == array_A[i+1]:
    bonus_position += [i]

bonus_dish = []
for i in bonus_position:
    bonus_dish += [array_A[i]]

bonus_point = 0
for i in bonus_dish:
    bonus_point += array_C[i-1]

score = sum(array_B) + bonus_point
print(score)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

ans = sum(b)
for i in range(n-1):
  if(a[i]+1==a[i+1]): ans+= c[i]
print(ans)

n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

ans = sum(b)
for i in range(n-1):
  if(a[i]+1==a[i+1]): ans+= c[a[i]-1]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=B[A[0]-1]
for i in range(1,n):
  ans+=B[A[i]-1]
  if A[i-1]+1==A[i]:
    ans+=C[i-1]
print(ans)


n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=A[0]
for i in range(n-1):
  ans+=B[A[i-1]]
  if A[i]+1==A[i+1]:
    ans+=C[i]
print(ans)


n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=A[0]
for i in range(n-1):
  ans+=A[i]
  if A[i]=A[i+1]:
    ans+=C[i]
print(ans)


n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=B[0]
for i in range(1,n):
  ans+=B[A[i]-1]
  if A[i-1]+1==A[i]:
    ans+=C[i-1]
print(ans)


n=int(input())
A=list(map(int,input().split()))
M=list(map(int,input().split()))
L=list(map(int,input().split())) ; ans=0
for i in range(n):
    ans+=M[A[i]-1]
    if i!=n-1:
        if A[i]+1==A[i+1]:
            ans+=L[A[i]-1]
print(ans)
    

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

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

list_A = list(map(int,input().split()))
list_B = list(map(int,input().split()))
list_C = list(map(int,input().split()))

b_val = 0

for i in range(N):
    aaa = list_A[i]
    b_val += list_B[aaa-1]
    if i ==0:
        continue
    elif aaa == list_A[i-1]+1:
        b_val += list_C[i-1]
        print(b_val)
print(b_val)




N = int(input())

list_A = list(map(int,input().split()))
list_B = list(map(int,input().split()))
list_C = list(map(int,input().split()))

b_val = 0

for i in range(N):
    aaa = list_A[i]
    b_val += list_B[aaa-1]
    if i ==0:
        continue
    elif aaa == list_A[i-1]+1:
        b_val += list_C[i-1]
print(b_val)




N = int(input())

list_A = list(map(int,input().split()))
list_B = list(map(int,input().split()))
list_C = list(map(int,input().split()))

b_val = 0

for i in range(N):
    aaa = list_A[i]
    b_val += list_B[aaa-1]
    if i ==0:
        continue
    elif aaa == list_A[i-1]+1:
        b_val += list_C[list_A[i-1]-1]
print(b_val)




Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
  count+= B[A[i]]
  if i>0 and A[i] = A[i-1]:
    count += C[A[i-1]]
print(count)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
  point += B[A[i]]
  if i>0 and A[i] == A[i-1]:
    point += C[A[i-1]]
print(point)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
  point += B[A[i]]
  if i>0 and A[i] = A[i-1]:
    point += C[A[i-1]]
print(point)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
point = 0

for i in range(N):
    point += B[A[i]-1]
    if i>0 and A[i]-1 == A[i-1]:
        point += C[A[i-1]-1]
print(point)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(n)
a = input().split()
b = input().split()
c = input().split()
a = [int(i) for i in a]
b = [int(i) for i in b]
c = [int(i) for i in c]

d = 0
for i in b:
  d += i

for i in range(n):
  if i + 1 < n:
    if a[i] +1  == a[i+1]:
      d += c[i-1]
  
print(d)

n = input()
n = int(n)
a = input().split()
b = input().split()
c = input().split()
a = [int(i) for i in a]
b = [int(i) for i in b]
c = [int(i) for i in c]

d = 0
for i in b:
  d += i

for i in range(n):
  if i + 1 < n:
    if a[i] +1  == a[i+1]:
      p = a[i]-1
      d += c[p]
  
print(d)

Verdicts: Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.append()
B.append()
ans=0
for i in range(1,N+1):
	ans+=B[A[i-1]-1]
	if A[i-1]==A[i]-1:
		ans+=C[A[i-2]]
print(ans)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.append(100)
B.append(100)
ans=0
for i in range(1,N+1):
	ans+=B[A[i-1]-1]
	if A[i-1]==A[i]-1:
		ans+=C[A[i-2]]
print(ans)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans=0
for i in range(N):
	ans+=B[A[i]]
	if A[i]==A[i-1]+1:
		ans+=C[A[i-1]]
print(ans)


C = list(map(int, input().split()))
A.append("")
B.append("")
ans=0
for i in range(1,N+1):
	ans+=B[A[i-1]-1]
	if A[i-1]==A[i]-1:
		ans+=C[A[i-2]]
print(ans)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
for i in range(N):
	ans+=B[A[i]]
	if A[i]==A[i-1]+1:
		ans+=C[A[i-1]]
print(ans)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.append(100)
B.append(100)
C.insert(0,0)
ans=0
for i in range(1,N+1):
	ans+=B[A[i-1]-1]
	if A[i-1]==A[i]-1:
		ans+=C[A[i-1]]
print(ans)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

s = b[a[0]-1]

for i in range(1,n):
    s += b[a[i]-1]
    if(a[i] == a[i-1]+1):s+=c[a[i-1]-1]
    print(i,s)
print(s)

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

s = b[a[0]-1]

for i in range(1,n):
    s += b[a[i]-1]
    if(a[i] == a[i-1]+1):s+=c[a[i-1]-1]
print(s)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
4
2 3 4 1
13 5 8 24
45 9 15

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

sumc = 0
ans = 0
for count in range(1,22):
    sumc = A * count 
    if sumc-count + 1 >= B:
        ans = count 
        break
print(ans)

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
sumc = 0

for count in range(N-1):
    if A[count+1] - A[count] == 1:
        sumc = sumc + C[A[count]-1]

print(sumc + sum(B))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.append(0)
max=0

for i in range(N):
    max=max+b[i]+c[i-1]
print(max)

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.insert(0,0)
max=0

for i in range(N):
    max=max+b[a[i]-1]
    max=max+c[a[i]-1]
print(max)

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.insert(0,0)
max=0
print(a,b,c)

for i in range(N):
    max=max+b[a[i]-1]
    max=max+c[a[i]-1]
print(max)

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.append(0)
max=0

for i in range(1,N+1):
    max=max+b[a[i]]+c[a[i-1]]
print(max)

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
max=0

for i in range(N):
    max=max+b[a[i]]+c[a[i-1]]
print(max)

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
c.insert(0,0)
max=0

for i in range(N):
    max=max+b[i]+c[i]
print(max)

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
max=sum(b)

for i in range(N-1):
    if a[i]==a[i+1]-1:
            max+=c[a[i]-1]
print(max)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = sum(B)
for t in range(N-1):
    if a[t] + 1 == a[t + 1]:
        m += C[a[t] - 1]
print(m)
         

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m += B[a[i] - 1]
for i in range(N-1):
    if a[i] + 1 == a[i + 1]:
        m += C[a[i] - 1]
print(m)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m += B[a[i] - 1]
for t in range(N-1):
    if a[t] + 1 == a[t + 1]:
        m += C[a[t] - 1]
print(m)
         

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m += B[a[i] - 1]
for t in range(N-1):
    if A[t] + 1 == A[t + 1]:
        m += C[A[t] - 1]
print(m)
         


N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m +=B[a[i] - 1]
for i in range(N-1):
    if a[i] + 1 == a[i + 1]:
        m +=C[a[i] - 1]
print(m)
         
    
    

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m=0
for i in range(N):
    m +=B[a[i] -1]
for i in range(N-1):
    if a[i] + 1 == a[i + 1]:
        m + =C[a[i] - 1]
print(m)
         
    

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m += B[a[i] - 1]
for t in range(N-1):
    if a[t] + 1 == a[t + 1]:
        m += C[a[t] - 1]
print(m)
         

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m=0
for i in range(N):
    m +=B[a[i] -1]
for i in range(N-1):
    if a[i] + 1 == a[i + 1]:
        m +=C[a[i] - 1]
print(m)
         
    

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
m = 0
for i in range(N):
    m += B[A[i] - 1]
for t in range(N-1):
    if A[t] + 1 == A[t + 1]:
        m += C[A[t] - 1]
print(m)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = sum(b)

for i in range(n-1):
  if a[i+1] - a[i] == 1:
    ans += c[i]
    

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = sum(b)

for i in range(n-1):
  if a[i+1] - a[i] == 1:
    ans += c[a[i]-1]
    
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
num = int(input())
A_i = [ int(x) for x in input().split()]
B_i = [ int(x) for x in input().split()]
C_i = [ int(x) for x in input().split()]

prev = 0
for a in a_i:
  result += B_i[a]
  if prev > 0 and a-1 == prev:
    result += C_i[prev]
  
print(result)

num = int(input())
A_i = [ int(x) for x in input().split()]
B_i = [ int(x) for x in input().split()]
C_i = [ int(x) for x in input().split()]
 
prev = 50
result = 0
for a in A_i:
  result += B_i[a-1]
  if a-1 == prev:
    result += C_i[prev-1]
  prev = a
  
print(result)

Verdicts: Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(input())
a_array = list(map(int(), input().split()))
b_array = list(map(int(), input().split()))
c_array = list(map(int(), input().split()))

c_array.append(0)

sum = 0

for m in a_array:
    sum += b_array[m-1]

for i in range(n-1):
    if (a_array[i] + 1 == a_array[i+1]):
        sum += c_array[a_array[i]-1]

print(sum)


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0
a.append(0)

for i in range(n):
    ans += b[i]
    if a[i+1] - a[i] == 1:
        ans += c[a[i]-1]

print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0

for i in range(1, N+1):
    a = A[i-1]
    ans += B[a-1]
    
for j in range(N):
    if A[j] == A[j-1]+1:
        ans += C[j-1]


print(ans)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
ans += sum(B)

for i in range(N-1):
    if A[i+1] == A[i]+1:
        ans += C[A[i]-1]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
ans = 0
for i, a in enumerate(A):
    ans += B[a-1]
    if a - A[i-1] == 1 and i-1 > 0:
        ans += C[i-2]
print(ans)

import numpy as np

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i, a in enumerate(A):    
    ans += B[a-1]
    
A_ = [-100] + A[:-1]
A_ = np.array(A_)
A = np.array(A)

A_diff = A - A_

for j in A[A_diff == 1] -1:
    ans += C[j-1]
print(ans)    

Verdicts: Runtime Error

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
m = 0
for i in range(n):
  m += b[a[i]-1]
  if i > 0 and a[i]-1==a[i-1]:
    m += c[i-1]
print(m)

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
m = sum(b)
for i in range(0,n-1):
  if a[i]+1==a[i+1]:
    m += c[a[i]-1]
print(m)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
satisfaction=0
count=0
for i in A:
    j = i-1
    count+=1
    print((len(B)-len(C)))
    if (j == N-(len(B)-len(C))) or count == N:
        satisfaction += B[j]
    else:
        satisfaction += B[j] + C[j]
print(satisfaction)

N=int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = sum(B)
for i in range(1, N):
    if A[i] - A[i-1] == 1:
        ans = ans + C[A[i]-2]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

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

table_1 = input().split(' ')
table_2 = input().split(' ')
table_3 = input().split(' ')
total = 0
for i in range(kind):
    total += int(table_2[i])

for j in range(kind-1):
    if int(table_1[j]) == int(table_1[j + 1]) - 1:
        total += int(table_3[j])
print(total)

kind = int(input())

table_1 = input().split(' ')
table_2 = input().split(' ')
table_3 = input().split(' ')
total = 0
for i in range(kind):
    total += int(table_2[i])
    
for j in range(kind-1):
    if int(table_1[j]) == int(table_1[j + 1]) - 1:
        total += int(table_3[int(table_1[j]) - 1])
print(total)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \ldots, Dish N) once.  The i-th dish (1 \leq i \leq N) he ate was Dish A_i.  When he eats Dish i (1 \leq i \leq N), he gains B_i satisfaction points.  Additionally, when he eats Dish i+1 just after eating Dish i (1 \leq i \leq N - 1), he gains C_i more satisfaction points.  Find the sum of the satisfaction points he gained.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split())) 
B = list(map(int, input().split())) 
C = list(map(int, input().split())) 

D = sum(B)

for i in range(N-1):
  if A[i+1]-A[i]==1:
    D = D + C[i]
  else:
    D = D

print(D)

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.append(0)
C.append(0)

D = sum(B)

for i in range(N):
  if A[i+1]-A[i]==1:
    D = D + C[A[i]-1]
  else:
    D = D

print(D)

Verdicts: Wrong Answer

Accepted