Problem:


Score : 100 points

Problem Statement

Given an integer a as input, print the value a + a^2 + a^3.

Constraints

1 \leq a \leq 10

a is an integer.

Input

Input is given from Standard Input in the following format:

a

Output

Print the value a + a^2 + a^3 as an integer.

Sample Input 1

2

Sample Output 1

14

When a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.

Print the answer as an input. Outputs such as 14.0 will be judged as incorrect.

Sample Input 2

10

Sample Output 2

1110



Sample input:
2


Sample output:
14

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
import bisect
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return x if y == 0 else gcd(y, x%y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

A = I()
print(A+A**2+A**3)

Submission status: Accepted

Solution code:
import math  # noqa: F401
from typing import Dict, List, Optional, Tuple, Union  # noqa: F401


def main(N: int):
    print(N + N ** 2 + N ** 3)


if __name__ == "__main__":
    N = int(input())
    main(N)

Submission status: Accepted

Solution code:
N = int(input())

print(N + N **2 + N ** 3)

Submission status: Accepted

Solution code:
#ABC172-A
a=int(input())
print(a+a**2+a**3)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


a = inp()
print(a + a**2 + a**3)

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    a = int(input())
    print(a + a * a + a * a * a)
resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log,gcd
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')

#Pythonを用いる場合
#numpy 1.18.0, scipy 1.4.1, scikit-learn 0.22, numba 0.47.0, networkx 2.4
 
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
from scipy.sparse import csr_matrix

 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a=ii()
print(a+a**2+a**3)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    a = int(input())

    ans = a + a ** 2 + a ** 3

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a = I()
print(a + a**2 + a**3)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    a = ii()
    print(a+a*a+a*a*a)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#s = input()
n = int(input())
#a, b, c = map(int, input().split())
#p = list(map(int, input().split()))

print(n + n**2 + n**3)

Submission status: Accepted

Solution code:
def yn(yn):
    if yn:
        print("Yes")
    else:
        print("No")


a = input()
# a = int(a)
a = int(a)
print(a + a * a + a * a * a)

Submission status: Accepted

Solution code:
num = int(input())

print(num + num**2 + num**3)

Submission status: Accepted

Solution code:
import sys
from collections import deque,Counter
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def Main():
    a = I()
    print(a+a**2+a**3)
    return

if __name__=='__main__':
    Main()

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    a = int(input())
    print(a + a * a + a * a * a)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a=ii()
print(a+a**2+a**3)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = INT()
print(a+a**2+a**3)

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

a = INT()
print(a + a ** 2 + a ** 3)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

Submission status: Accepted

Solution code:
# ABC172a


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    a = I()
    print(a+a**2+a**3)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
a = int(input())
)
a = int(a ** 3)
print(a)

Submission status: Runtime Error

Solution code:
a = input()

print(a+ a*a + a*a*a)

Submission status: Runtime Error

Solution code:
s = input()
t = input()

count = 0

for i in range(len(s)):
    if s[i] != t[i]:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N,M,K = map(int,input().split())	
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a=[0]
b=[0]
for i in range(N):
  a.append(a[-1]+A[i])
for j in range(M):
  b.append(b[-1]+B[j])  
for i in range(len(A)+1):
  for j in range(len(B)+1):
    score=a[i]+b[j]
    if score <= K:
      point=[]
      point.append(i+j)
print(max(point))

Submission status: Runtime Error

Solution code:
a = int(input())
print(a + a ** 2 + a *** 3)

Submission status: Runtime Error

Solution code:
a = input()
print(a + a ** 2 + a ** 3)

Submission status: Runtime Error

Solution code:
a = input()
print(int(a+a**2+a**3))

Submission status: Runtime Error

Solution code:
from itertools import accumulate
import bisect

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

a_acc = [0] + list(accumulate(a))  # aを0冊読む=1冊も読まない場合があるので、[0]を先頭に追加します
b_acc = list(accumulate(b))  # bisect_rightでは、x以下の要素がいくつあるか？を求めるので、こちらに0は入れません

ans = 0
for an in range(n + 1):
    rem = k - a_acc[an]
    if rem < 0:
        # aをこれ以上読めません
        break

    bn = bisect.bisect_right(b_acc, rem)
    ans = max(ans, an + bn)

print(ans)

Submission status: Runtime Error

Solution code:
a = input()
print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
import sys

n = sys.stdin.readlines()
print(n + n ** 2 + n ** 3)

Submission status: Runtime Error

Solution code:
a = int(input())

print(a*(1+a(1+a)))

Submission status: Runtime Error

Solution code:
def solve(string):
    a = int(string)
    return str(a + a**2 + a**3)                                                                                         

if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
~                                                                                                                       ~                                                                                                                       ~                                                                                                                       ~                                                                                                                       ~

Submission status: Runtime Error

Solution code:
a = int(input())

ans = a(1+a+a**2)
print(int(ans))

Submission status: Runtime Error

Solution code:
a = input()

print(a+pow(a,2)+pow(a,3))

Submission status: Runtime Error

Solution code:
num = int(input())
print(num + num * mum + num ** 3)

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;

int main()
{
	int a;
	cin >> a;
	cout << a * a + a + a * a * a <<endl;
}

Submission status: Runtime Error

Solution code:
a = input()
print(a + a**2 + a**3)

Submission status: Runtime Error

Solution code:
a = input()
print(1+ a**2 + a**3)

Submission status: Runtime Error

Solution code:
a = int(input())
print(a + a**2 + a***a)

Submission status: Runtime Error

Solution code:
N=int(input())
print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
a=int(input())
if 1<=a<=10:
print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
a = input()
print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
from collections import deque
N,M,K = map(int,input().split())
A = deque(map(int,input().split()))
B = deque(map(int,input().split()))

A.append(float('inf'))
B.append(float('inf'))

time = K 
count = 0
sum_A = sum(list(A)[:-1])
sum_B = sum(list(A)[:-1])
for _ in range(len(A)+len(B)):
    if A[0] > B[0]:
        target = B.popleft()
        if (target > (sum_A-A[0])) and len(A) != 1:
            sum_A -= A[0]
            B.appendleft(target) 
            target = A.popleft()
        time -= target
        count += 1
    else:
        target = A.popleft()
        if (target > (sum_B-B[0])) and len(B) != 1:
            sum_B -= B[0]
            A.appendleft(target)
            target = B.popleft()
        time -= target
        count += 1
    if len(A) == len(B) == 1:
        break
    if time < 0:
        count -= 1
        break 
    elif time == 0:
        break
print(count)

Submission status: Runtime Error

Solution code:
N,M,K=map(int,input().split())
Ai=list(map(int,input().split()))
Bi=list(map(int,input().split()))
list=[]
for i in range(N+M):
    if A[i]>B[i]:
        list.append(B[i])
    else:
        list.append(A[i])
        if sum(list)>=K:
            break
print(len(list))

Submission status: Runtime Error

Solution code:
a = int(input)
n = a + a*a + a*a*a
print(n)

Submission status: Runtime Error

Solution code:
b=a+ a**2 + a**3
print(b)

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
list=[0 for i in range(5*10**5+1)]
mod=10**9+7
list[0]=1
for i in range(len(list)-1):
  list[i+1]=list[i]*(i+1)%mod
def c(m,n):
  a=list[m]*pow(list[m-n],mod-2,mod)*pow(list[n],mod-2,mod)
  return a
def p(m,n):
  a=list[m]*pow(list[m-n],mod-2,mod)
  return a
ans=pow(p(M,N),2)
g=pow(list[M-N],mod-2,mod)
g2=pow(g,2,mod)
nn=list[N]
mm=list[M]
nmg=nn*mm*g2%mod
for i in range(1,N+1):
  ans+=nmg*pow(list[N-i],mod-2,mod)*pow(list[i],mod-2,mod)*list[M-i]*(-1)**i
  ans%=mod
print(ans)

Submission status: Runtime Error

Solution code:
A = input()

print(A+A**2+A**3)

Submission status: Runtime Error

Solution code:
a=int(input()) print(a+a*a+a**3)

Submission status: Runtime Error

Solution code:
a=input()
print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
a = int(input())
print(int(a+(a**2)+(a**3))

Submission status: Runtime Error

Solution code:
from collections import deque

N, M, K = map(int, input().split())
A = deque(list(map(int, input().split())))
B = deque(list(map(int, input().split())))
time = 0
count = 0
nextA = A.popleft()
nextB = B.popleft()

while(True):
    if nextA == None and nextB == None:
        break
    if nextA == None:
        do = "popB"
    elif nextB == None:
        do = "popA"
    elif nextA < nextB:
        do = "popA"
    else:
        do = "popB"
    
    if do == "popA":
        count += 1
        time += nextA
        if len(A) == 0:
            nextA = None
        else:
            nextA = A.popleft()
    else:
        count += 1
        time += nextB
        if len(B) == 0:
            nextB = None
        else:
            nextB = B.popleft()
    if time == K:
        break
    if time > K:
        count -= 1
        break

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
n, m, k = input().split()
a = input().split()
b = input().split()

n = int(n)
m = int(m)
k = int(k)
a = list(map(int, a))
b = list(map(int, b))

a.extend(b)
a.sort()

add = 0
cnt = 0
for item in a:
  if add > k:
    break
  add += item
  cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
num=int(input())
print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
S=input()
T=input()

count=0
for i in range(len(S)):
  if S[i]!=T[i]:
    count+=1
    
print(count)

Submission status: Runtime Error

Solution code:
a = input()
print(a + a * a + a * a * a)

Submission status: Runtime Error

Solution code:
input a
b=a**3+a**2+a
c=int(b)
print(c)

Submission status: Runtime Error

Solution code:
print(int(a*(a**2+a+1)))

Submission status: Runtime Error

Solution code:
print(a*(a**2+a+1))

Submission status: Runtime Error

Solution code:
a = int(intput())

print(a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:

    a = int(input())

    print(a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.append(k+1)
b.append(k+1)
ia = 0
ib = 0
count = 0

for i in range(n + m + 1):
    if (a[ia] < b[ib]):
        if(a[ia] > k):
            print(count)
            break
        else:
            k -= a[ia]
            ia += 1
            count += 1
    else:
        if(b[ib] > k):
            print(count)
            break
        else:
            k -= b[ib]
            ib += 1
            count += 1

Submission status: Runtime Error

Solution code:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.append(k+1)
b.append(k+1)
ia = 0
ib = 0
count = 0

for i in range(n + m + 1):
  if (a[ia] < b[ib]):
    if(a[ia] > k):
      print(count)
      break
      else:
        k -= a[ia]
        ia += 1
        count += 1
        else:
          if(b[ib] > k):
            print(count)
            break
            else:
              k -= b[ib]
              ib += 1
              count += 1

Submission status: Runtime Error

Solution code:
a = int(input)
b = a + a^2 * a^3
print(b)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())
book_list = list(map(int,input().split()))
book_list.extend(list(map(int,input().split())))
book_list.sort()
count=0
readTime=0
for i in range(n+m):
    if readTime+book_list[i]<=k:
        count+=1
        readTime+=book_list[i]
    else:
        break
print(count)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
print(sum(s != t for s, t in zip(S, T)))

Submission status: Runtime Error

Solution code:
s = input (int())
x = s+s*s+s*s*s
print(x)

Submission status: Runtime Error

Solution code:
s = input int()
x = s+s*s+s*s*s
print(x)

Submission status: Runtime Error

Solution code:

for i in range(10)
a=i+1
print(a+a^2+a^3)

Submission status: Runtime Error

Solution code:
b=a+a^2+a^3
print(b)

Submission status: Runtime Error

Solution code:
a=int(input())
input(a+a*a+a**3)

Submission status: Runtime Error

Solution code:
x=input()
print(x+(int)(pow(x,2)+(int)(pow(x,3)))

Submission status: Runtime Error

Solution code:
n,m,k=map(int,input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
ans=0
a, b=[0], [0]
for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
for i in range(n+1):
    if k<a[i]:
        break
    j=m
    while b[j]>k-a[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n,m,k=map(int,input().split())
A=[0]
A.append(list(map(int, input().split())))
B=[0]
B.append(list(map(int, input().split())))
ans=0
a=np.cumsum(np.array(A))
b=np.cumsum(np.array(B))
for i in range(n+1):
    if k<a[i]:
        break
    j=m
    while b[j]>k-a[i]:
        j-=1
        ans=max(ans,i+j)
print(ans)

Submission status: Runtime Error

Solution code:
n=int(intput())

print(n+n**n+n***n)

Submission status: Runtime Error

Solution code:
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

cnt, i, j, time = 0, 0, 0, 0

while i < n and j < m:
  if time + min(a[i], b[j]) > k:
    break
  time += min(a[i], b[j])
  if a[i] <= b[j]:
    i += 1
  else:
    j += 1
  cnt += 1

while i < n:
  if time + a[i] > k:
    break
  time += a[i]
  cnt += 1
  i += 1
  
while j < m:
  if time + b[j] > k:
    break
  time += b[j]
  cnt += 1
  j += 1
print(cnt)

Submission status: Runtime Error

Solution code:
a = input()
my_result = a + a*a + a*a*a
print(my_result)

Submission status: Runtime Error

Solution code:
a = input()
my_result = a + a**2 + a**3
print(my_result)

Submission status: Runtime Error

Solution code:
a = int(input())
my_result = a + a**2 + a ***3
my_result

Submission status: Runtime Error

Solution code:
a = input()
print(a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:
print(a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:
S = input()
T = input()

count = 0
for i in range(len(S)):
	if S[i] != T[i]:
		count = count + 1

print(count)

Submission status: Runtime Error

Solution code:
a = int(input())
ans = a*(1+a+a*a*)
print(ans)

Submission status: Runtime Error

Solution code:
S = list(input())
T = list(input())

length = int(len(S))
difference = 0

for i in range(length):
    if S[i] != T[i]:
        difference = difference + 1

if difference%2 == 0:
    change = difference/2
if difference%2 != 0:
    change = (difference+1)/2
    
print(str(change))

Submission status: Runtime Error

Solution code:
import numpy as np

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

As = np.array(list(map(int,input().split())))
Bs = np.array(list(map(int,input().split())))

As_selected = []
Bs_selected = []

answer = 0

for i in range(N+1):
    if(As[0:i].sum() <= K):
         As_selected.append(As[0:i].sum())
    else:
        break
for i in range(M+1):
    if(Bs[0:i].sum() <= K):
         Bs_selected.append(Bs[0:i].sum())
    else:
        break

answer = 0

for i in np.arange(len(As_selected))+1:
    for j in np.arange(len(Bs_selected))+1:
        if(As_selected[-i] > K):
            break

        if(As_selected[-i] + Bs_selected[-j] <= K):
            answer = max(len(As_selected)+len(Bs_selected) -i - j, answer)
            break

print(answer)

Submission status: Runtime Error

Solution code:
import numpy as np

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

As = np.array(list(map(int,input().split())))
Bs = np.array(list(map(int,input().split())))

As_selected = []
Bs_selected = []

answer = 0

for i in range(N+1):
    if(As[0:i].sum() <= K):
         As_selected.append(As[0:i].sum())
    else:
        break
for i in range(M+1):
    if(Bs[0:i].sum() <= K):
         Bs_selected.append(Bs[0:i].sum())
    else:
        break

answer = 0

for i in np.arange(len(As_selected))+1:
    for j in np.arange(len(Bs_selected))+1:
        if(As_selected[-i] + Bs_selected[-j] <= K):
            answer = max(len(As_selected)+len(Bs_selected) -i - j, answer)
            break

print(answer)

Submission status: Runtime Error

Solution code:
#include <stdio.h>

int main(){
    int a;
    scanf("%d",&a);

    printf("%d\n",a+(a*a)+(a*a*a));
    return 0;

}

Submission status: Runtime Error

Solution code:
a = input()
b = a * (1 + a + (a * a )
print(b)

Submission status: Runtime Error

Solution code:
a=input()
b=a*a*a+a*a+a
print(b)

Submission status: Runtime Error

Solution code:
def get_sum_arr(arr):
    sum_arr = [0]
    N = len(arr)
    for i in range(1,N+1):
        sum_arr.append(sum_arr[i-1] + arr[i-1])
    return sum_arr

def get_max_b(left_time,j,B_sum_arr):
    # [0,1,2,3,4,5]
    while B_sum_arr[j] >= left_time and j > 0:
        j -= 1
    return j
def get_max_book_num(A,B,K):
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    count,i,j = 0,0,len(B_sum_arr)-1
    for i in range(0,len(A_sum_arr)):
        if K < A_sum_arr[i]:
            break
        else:
            left_time = K - A_sum_arr[i]
            j = get_max_b(left_time,j,B_sum_arr)
        count = max(count,(i+j))
    return count

if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
     # [0,1,2,3,4,5]
    B = list(map(int,input().split()))
     # [0,1,2,3,4,5]
    print(get_max_book_num(A,B,K))

Submission status: Runtime Error

Solution code:
num = input()
print(num+num**2+num**3)

Submission status: Runtime Error

Solution code:
ソースコード 

Copy
Copy
def a172(a):
 
    return a + a**2 + a**3
 
def main():
    a = int(input())
    print(a172(a))
 
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a = int(input())
print(sum(a+a**2+a**3))

Submission status: Runtime Error

Solution code:
number = int(intput())
print(number + number**2 + number**3)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

print(a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:
num v= input("")
sum1 = num + num^2 + num^3

Submission status: Runtime Error

Solution code:
a = int(input)
ans = a + a*a + a*a*a
print(ans)

Submission status: Runtime Error

Solution code:
n = map(x**3 + x**2 + x,int(input()))
print(n)

Submission status: Runtime Error

Solution code:
a=input()
print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
a = input()
print(a+a**2+a**3)

Submission status: Runtime Error

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

A_sum = [0]
B_sum = [0]
for i in range(N):
    A_sum.append(A_sum[i]+A[i])
for i in range(M):
    B_sum.append(B_sum[i]+B[i])


num = 0
J = M
for i in range(N+1):
    if A_sum[i] > K:
        break
    for j in (J,-1,-1):
        if A_sum[i] + B_sum[j] <= K:
            if num < i+j:
                num = i+j
            J = j
            break

print(num)

Submission status: Runtime Error

Solution code:
a=input()
print(a+a^2+a^3)

Submission status: Runtime Error

Solution code:
a = map(int,input())
print(a + a**2 + a**3)

Submission status: Runtime Error

Solution code:
number=a
if number>0 and number<10:
    print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
number=a
if 1<a and a <10:
	print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
a = int(imput)
print(a(1+a(1+a)))

Submission status: Runtime Error

Solution code:
a = int(input)
b = a**2
c = a**3
print(a+b+c)

Submission status: Runtime Error

Solution code:
a = int(input)

print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
int b
b = a + a^2 + a^3
return b

Submission status: Runtime Error

Solution code:
a = input()
answer = a + a**2 + a **3
print(answer)

Submission status: Runtime Error

Solution code:
s=input()
t=input()
c=0
for i in range(len(s)):
  if s[i]!=t[i]:
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
k = len(T)
m = 0
for i in range(k):
  if S[i] != T[i]:
    m += 1
print(m)

Submission status: Runtime Error

Solution code:
a = input()

print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
a = int(a)
x = a + a**2 + a**3
print(x)

Submission status: Runtime Error

Solution code:
a = int(a)
x = int(x)
x = a + a**2 + a**3
print(x)

Submission status: Runtime Error

Solution code:
ans = a + a**2 + a **3
print(ans)

Submission status: Runtime Error

Solution code:
print(a + (a*a) + (a*a*a))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-


# def main():
#     n, m, k = map(int, input().split())
#     A = list(map(int, input().split()))
#     B = list(map(int, input().split()))
#     a = A[0]
#     A2 = [a]
#     b = B[0]
#     B2 = [b]
#     for i in range(1, n):
#         a += A[i]
#         A2.append(a)
# 
#     for i in range(1, m):
#         b += B[i]
#         B2.append(b)
#     max = -2
#     for ia, aa in enumerate(A2):
#         for ib, bb in enumerate(B2):
#             if aa + bb > k:
#                 break
#             if ia + ib > max:
# 
#                 max = ia + ib
#     print(max + 2)
# 

def answer():
    N, M, K = map(int, input().split())


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

    a, b = [0], [0]
    for i in range(N):
        a.append(a[i] + A[i])
    for i in range(M):
        b.append(b[i] + B[i])

    ans, j = 0, M
    for i in range(N + 1):
        if a[i] > K:
            break
        while b[j] > K - a[i]:
            j -= 1
        ans = max(ans, i + j)
    print(ans)
if __name__ == '__main__':
    answer()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-


def main():
    n, m, k = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    a = A[0]
    A2 = [a]
    b = B[0]
    B2 = [b]
    for i in range(1, n):
        a += A[i]
        A2.append(a)

    for i in range(1, m):
        b += B[i]
        B2.append(b)
    max = -2
    for ia, aa in enumerate(A2):
        for ib, bb in enumerate(B2):
            if aa + bb > k:
                break
            if ia + ib > max:

                max = ia + ib
    print(max + 2)


def answer():
    N, M, K = map(int, input().split())


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

    a, b = [0], [0]
    for i in range(N):
        a.append(a[i] + A[i])
    for i in range(M):
        b.append(b[i] + B[i])

    ans, j = 0, M
    for i in range(N + 1):
        if a[i] > K:
            break
        while b[j] > K - a[i]:
            j -= 1
        ans = max(ans, i + j)
    print(ans)
if __name__ == '__main__':
    answer()