Problem:


Score : 100 points

Problem Statement

There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?

Constraints

1≦N≦100

Input

The input is given from Standard Input in the following format:

N

Output

Print the necessary number of candies in total.

Sample Input 1

3

Sample Output 1

6

The answer is 1+2+3=6.

Sample Input 2

10

Sample Output 2

55

The sum of the integers from 1 to 10 is 55.

Sample Input 3

1

Sample Output 3

1

Only one child. The answer is 1 in this case.



Sample input:
3


Sample output:
6

Submission status: Runtime Error

Solution code:
S=sum(N/2(N-1))
print(S)

Submission status: Runtime Error

Solution code:
N = int(input())
return(N*(N+1)//2)

Submission status: Runtime Error

Solution code:
count = 0
for i range(int(input()) + 1):
  if i == 0:
    continue
  count += i
print(count)

Submission status: Runtime Error

Solution code:
n = input()
result = 0

for i in range(n):
  result += i

print(result)

Submission status: Runtime Error

Solution code:
n = input()
result = 0

for i in n:
  result += i

print result

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(1,N):
  tmp += i
print(tmp)

Submission status: Runtime Error

Solution code:
a=int(input())
S=(N+1)*N/2
print(S)

Submission status: Runtime Error

Solution code:
num=input()
candy=0
ans=0
for i in range(num):
  candy+=1
  ans+=candy
print(ans)

Submission status: Runtime Error

Solution code:
input_ = [input() for i in range(4)]

N, K, X, Y = input_

acc = 0

if N > K:
    acc = int(K) * int(X) + (int(N) - int(K)) * int(Y)
else:
    acc = int(N) * int(X)

print(acc)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for i in range(1, n+1)
    ans += i
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for i in range(1, n)
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for i in range(1, n+1)
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
#ABC043A
N = int(input())

if(q==1):
    print("1")
else:
    q, mod = divmod(N, 2)
    if (mod > 0): q += 1

    print((N+1)*q)

Submission status: Runtime Error

Solution code:
=int(input())
sum=0
for i in range(n):
  sum+=(i+1)
print(sum)

Submission status: Runtime Error

Solution code:
n=int(input())
sum=0
for i in range(1:n+1):
  sum+=i
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
print(N*(N+1)//2

Submission status: Runtime Error

Solution code:
N = input()
a = list(map(int,input().split()))
cost_sum = 0
print_cost = 20000

for a_i in range(min(a), max(a)+1):
    for a_j in a:
        cost_sum += ((a_j - a_i) ** 2)
    if print_cost > cost_sum:
        print_cost = cost_sum

print(print_cost)

Submission status: Runtime Error

Solution code:
N = int(input())

print((N*(N+1)//2)

Submission status: Runtime Error

Solution code:
def main():
    n = input()
    print((n * (n + 1)) / 2)
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int,input().split()))
 
ans = []
for i in range(-100, 101):
    total = 0
    for ai in a:
        total += (ai - i)**2
    ans.append(total)
 
print(min(ans))

Submission status: Runtime Error

Solution code:
lines = list(input())
answers = []
out = ""
for line in lines:
    if line == "0" or line == "1":
        answers.append(line)
    else:
        answers.pop()
for answer in answers:
    out += answer
print(out)

Submission status: Runtime Error

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

int main()
{
    int n;
    cin >> n;
    cout << n * (n + 1) / 2 << endl;
}

Submission status: Runtime Error

Solution code:
print((int(input())+1)*n//2)

Submission status: Runtime Error

Solution code:
import java.util.*;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int ans = 0;
		for(int i = 0;i <= N; i++) {
			ans += i;
		}
		System.out.println(ans);
	}
}

Submission status: Runtime Error

Solution code:
print(sum(range(int(input())+1))

Submission status: Runtime Error

Solution code:
print(sum(range(1,int(input())+1))

Submission status: Runtime Error

Solution code:
N=int(input())

out=0
for i in range(N):
  out+=i+1
return out

Submission status: Runtime Error

Solution code:
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
// #include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

int gcd(int a, int b)
{
        return b ? gcd(b, a % b) : a;
}

int main() //input->compute->output
{
        int N, K;
        cin >> N;

        cout << N * (N +1) / 2 << endl;

        return 0;
}

Submission status: Runtime Error

Solution code:
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
// #include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

int gcd(int a, int b)
{
        return b ? gcd(b, a % b) : a;
}

int main() //input->compute->output
{
        int N, K;
        cin >> N;
        
        cout << N*(N-1)/2 << endl;

        return 0;
}

Submission status: Runtime Error

Solution code:
N = int(input)
for total in N:
  print(N * (N + 1)/2)

Submission status: Runtime Error

Solution code:
N = int(input())
for total in N:
  (N += 1)
  print(N + (N + 1))

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0
for i in range(0,N+1):
  sum + i = sum
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0
for i in range(0,N):
  sum + i = sum
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0
for i  in N:
  sum + i = sum
print(sum)

Submission status: Runtime Error

Solution code:
n = int().input()
print (str(int(n*(n+1)/2)))

Submission status: Runtime Error

Solution code:
x=input()
candies=0
for y in x:
  candies+=(y+1)
print(candies)

Submission status: Runtime Error

Solution code:
x=input()
candies=0
for y in x:
  candies+=(y+1)
print(candies)

Submission status: Runtime Error

Solution code:
print(sum([x for x in range(1,int(input().split())+1)]))

Submission status: Runtime Error

Solution code:
n = int(input())
s = 0
for i in range(N+1):
    s += i
print(s)

Submission status: Runtime Error

Solution code:
n = int(input()
s = 0
for i in range(N+1):
    s += i
print(s)

Submission status: Runtime Error

Solution code:
n= int(input())
print(int((n*(n+1))/2))
print(1+n)*n/2

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
for i in range(a,n):
  ans += i
  
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
print(n(n+1)/2)

Submission status: Runtime Error

Solution code:
N = int(imput())
print(N*(N+1)/2)

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(1,N):
  sum += i
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())

def Couter(n):
    return n + Couter(n-1)

Couter(N)

Submission status: Runtime Error

Solution code:
N = int(input())
n = 0

for i in range(1,N+1,1)
  n += i
  
print(n)

Submission status: Runtime Error

Solution code:
N = int(input())

while n <= N:
  n += 1
  
print(str(n))

Submission status: Runtime Error

Solution code:
n = input().int()
x = 1 + n
y = n / 2
z = x * y
print(z)

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(n):
  ans += (i+1)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

c = 0
for i in range(n+1)
    c +=i
print(c)

Submission status: Runtime Error

Solution code:
a=int(input())
s=o
for i in range(1,a+1,1):
    s+=i
print(s)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
cost=999999
for i in range(-100,1,101):
    c=0
    for j in b:
        c=c+(i-j)**2
    if c<cost:
        cost=c
print(cost)

Submission status: Runtime Error

Solution code:
a=int(input())
b=list(map(int,input().split()))
cost=999999
for i in range(-100,101):
    c=0
    for j in b:
        c=c+(i-j)**2
    if c<cost:
        cost=c
print(cost)

Submission status: Runtime Error

Solution code:
N=int(input())
print(n*(n+1)/2)

Submission status: Runtime Error

Solution code:
a = int(input())
sum = 0
for i in range(i+1):
    sum += i
print(sum)

Submission status: Runtime Error

Solution code:
a = input()
sum = 0
for a in range(a):
    sum += a
print(sum)

Submission status: Runtime Error

Solution code:
print(0.5*N*(N+1))

Submission status: Runtime Error

Solution code:
print(0.5(N+1)^2)

Submission status: Runtime Error

Solution code:
r = int(input())
sum = 0
for i in range(n):
  sum += i+1
print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())

print(int((1 + N) * N / 2)

Submission status: Runtime Error

Solution code:
s=input()
S=list(s)
L=len(S)
A=[]
for i in range(L):
    if S[i]=='0' or S[i]=='1':
        A.append(S[i])
    elif S[i]=='B' and len(A)==0:
        A.append('')
    else:
        A.remove(A[-1])
a=''.join(A)
print(a)

Submission status: Runtime Error

Solution code:
print(sum(range(int(input()+1))))

Submission status: Runtime Error

Solution code:
n=input(int())

print(int(n*(n+1)/2))

Submission status: Runtime Error

Solution code:
print(N*(N+1)/2)

Submission status: Runtime Error

Solution code:
n=input()
a=0
for i in range(1,n+1):
  a=a+1
print(a)

Submission status: Runtime Error

Solution code:
print(map(lambda x:x*(x+1)/2,input())

Submission status: Runtime Error

Solution code:
N = int(input())
result = 0
for i in (N+1):
  result += i
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
for i in range(n+1):
  num += i
print(num)

Submission status: Runtime Error

Solution code:
n = int(input())
for n in range(n+1):
  num += n
print(num)

Submission status: Runtime Error

Solution code:
n=input()
ans=n*(n+1)/2
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
b = N*(N+1)/2
print(int(b))

Submission status: Runtime Error

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

N: int = int(input())

sum = 0
for x in range(1, N + 1):
    sum += x

print(sum)

Submission status: Runtime Error

Solution code:
N=input()
ans=0
for i in range(N):
  ans+=N
print(ans)

Submission status: Runtime Error

Solution code:
N  = int(input())

print((1+N)(N)//2)

Submission status: Runtime Error

Solution code:
N  = input()
ans = 0
for i in range(N+1):
  ans += i
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

a = [i for in range(1, n+1)]
b = sum(a)
  
print(a)

Submission status: Runtime Error

Solution code:
n = int(input())
A = list(map(int,input().split()))
ans = []
for i in range(-100,101):
    c = 0
    for a in A:
        c += abs((i-a)**2)
    ans.append(c)

print(min(c))

Submission status: Runtime Error

Solution code:
n = int(input())
k = 0
for i range(:n+1):
  k += i

Submission status: Runtime Error

Solution code:
Sum=0
for i in range(N):
  Sum+=i+1
print(Sum)

Submission status: Runtime Error

Solution code:
N = int(input())
ai_list = list(map(int, input().split()))

import math
from statistics import mean, median
mean_ai = mean(ai_list)
median_ai = median(ai_list)
mean_lo = math.floor(mean_ai)
mean_high = math.ceil(mean_ai)

ans_list = []
cost1 = 0
cost2 = 0
cost3 = 0
for n in ai_list:
  cost1 += (n - mean_lo)**2
  cost2 += (n - mean_high)**2
  cost3 += (n - median_ai)**2
ans_list.append(cost1)
ans_list.append(cost2)
ans_list.append(cost3)
print(min(ans_list))

Submission status: Runtime Error

Solution code:

while True:
    n = int(input())
    sum = int(0)
    for i in range(1,n+1):
        sum += i
    print(sum)

Submission status: Runtime Error

Solution code:
n=int(input())
print(int (n(n+1)/2))

Submission status: Runtime Error

Solution code:
N=input()
i=1
while i<N:
    s+=i
    i+=1
    print(s)

Submission status: Runtime Error

Solution code:
N=input()
S=N(N+1)//2
print(S)

Submission status: Runtime Error

Solution code:
N = int(input())
print(int(N * (N + 1) / 2)

Submission status: Runtime Error

Solution code:
n = int(input))
print((n + 1)*n/2)

Submission status: Runtime Error

Solution code:
print(int(input())*(int(input())+1)//2)

Submission status: Runtime Error

Solution code:
N = input()
sum = N*(N+1)/2 
print(sum)

Submission status: Runtime Error

Solution code:
N=input()
print(N*(N+1)//2)

Submission status: Runtime Error

Solution code:
import math
int i
i=input()
sum=(1+n)*n/2
if i!=1:
        print(sum)
        print("The sum of the integers from 1 to"+i+" is"+sum+".")
else:
        print(sum)
        print("Only one child. The answer is 1 in this case.")

Submission status: Runtime Error

Solution code:
import math
int i
i=input()
sum=(1+n)*n/2
if i!=1:
        print(sum)
        print("The sum of the integers from 1 to"+i+" is"+sum .)
else:
        print(sum)
        print("Only one child. The answer is 1 in this case.)

Submission status: Runtime Error

Solution code:
def solve(n):
  return sum([1..n])

print(solve(int(input())))

Submission status: Runtime Error

Solution code:
n=int(input());print(n(n+1)//2)

Submission status: Runtime Error

Solution code:
print sum(range(1, int(raw_input() + 1)))

Submission status: Runtime Error

Solution code:
print(int((N=int(input())) * (N+1) /2))

Submission status: Runtime Error

Solution code:
print((N=int(input()) * (N+1) /2)

Submission status: Runtime Error

Solution code:
n=int(input())

print((1+N)*N//2)

Submission status: Runtime Error

Solution code:
s = int(input())
if s == 1:
  print(1)
else:
  print(int((1+s)*n/2))

Submission status: Runtime Error

Solution code:
print(sum([x for i in range(int(input())+1)]))

Submission status: Runtime Error

Solution code:
print((lambda x:x* x-~/2)(int(input())))

Submission status: Runtime Error

Solution code:
# ６月６日
a = int(input())
b = int(input())
c = int(input())
d = (a+b)*c//2
print(d)

Submission status: Runtime Error

Solution code:
    inn = int(input())
    r = 0
    for i in range(1,inn+1):
      r += i
    print(r)

Submission status: Runtime Error

Solution code:
a=int(input())
c==0
while a==0:
  c+=a
  a-=1
print(int(c))

Submission status: Runtime Error

Solution code:
a=int(input())
while a==0:
  c+=a
  a-=1
print(int(c))

Submission status: Runtime Error

Solution code:
# coding: utf-8
n=int(input().split())
a=0
for i in range(1,n+1):
    a+=i
print(a)

Submission status: Runtime Error

Solution code:
n = raw_input()
print (n*(n-1)/2)

Submission status: Runtime Error

Solution code:
n = int(input())
res= 0
if i in range(n)
    res += i+1
print(res)

Submission status: Runtime Error

Solution code:
print((n=int(input()))*-~n>>1)

Submission status: Runtime Error

Solution code:
def fact(n):
    if n <= 0:
        return 1
    return n * fact(n - 1)

n = input()
print(fact(n))

Submission status: Runtime Error

Solution code:
N = int(input())
print(int(N * (N+1) / 2)

Submission status: Runtime Error

Solution code:
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))

n = ri()
print(n(n+1)/2)

Submission status: Runtime Error

Solution code:
a = int(input())
b = 1

for i in range(a)
    b = b * a

print(b)

Submission status: Runtime Error

Solution code:
n=input()
print(n*(n+1)//2)

Submission status: Runtime Error

Solution code:
N = raw_input('')
x = (int(N) + 1) * int(N)/2
print(x)

Submission status: Runtime Error

Solution code:
n = input()
print((n*(n+1))/2)

Submission status: Runtime Error

Solution code:
n = input()

arr = map(int, raw_input().split())
if n == 1:
	print 0
else:
	mid = (arr[0] + arr[-1])/2
	ans = 0
	for e in arr:
		ans += (e-mid)**2
	print ans

Submission status: Runtime Error

Solution code:
n=int(input())
s=[int(x) for x in input().split()]
s.sort()
a=s[0]
b=s[-1]
m=9999999999999
for i in range(a,b+1):
    sum=0    
    for j in s:
        sum+=(j-i)**2
    if sum < m:
        m=sum
        
print(m)

Submission status: Runtime Error

Solution code:
N = int(raw_input())

numbers = map(int, raw_input().split())

min_num = min(numbers)
max_num = max(numbers)
min_cost = None 


for result in xrange(min_num, max_num+1):
    cost = 0 
    for number in numbers:
        cost += (number - result)**2
    if min_cost:
        if min_cost >= cost:
            min_cost = cost 
    else:
        min_cost = cost
print min_cost

Submission status: Runtime Error

Solution code:
import sys

n = int(sys.stdin().strip())

result = str(int(n * (n + 1) / 2))

sys.stdout()

Submission status: Runtime Error

Solution code:
N=raw_input()

n=0

for i in range(0,N):
    n+=i

print n

Submission status: Runtime Error

Solution code:
n=raw_input()
n*(n-1)/2

Submission status: Runtime Error

Solution code:
raw_input()
a = [int(x) for x in raw_input().split()]
bsc = 1e10
for i in range(-101, 102):
  sc = 0
  for j in a:
    sc += (j-i)**2
  bsc = min(bsc, sc)
print bsc

Submission status: Runtime Error

Solution code:
import sys

sys.stdin = open('a_2.txt', 'r')
N = int(raw_input())

print str(((N+1) * N) / 2)

Submission status: Runtime Error

Solution code:
A = 0
S = input()
fot n in range(1,int(S)+1):
 A = A + n
print(A)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import sys

n = int(row_input())

print n*(n+1)/2

Submission status: Runtime Error

Solution code:
# coding: utf-8

n = int(row_input())

print n*(n+1)/2

Submission status: Runtime Error

Solution code:
A = 0
S = input()
fot n in range(1,int(S)+1):
 A = A + n

Submission status: Runtime Error

Solution code:
A = 0
S = input()
fot n in tange(1,int(S)+1):
 A = A + n

Submission status: Runtime Error

Solution code:
N = input()
print(N * (N + 1) / 2)

Submission status: Runtime Error

Solution code:
import numpy as np
import math
N = int(input())

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

c = round(a.mean())

res = int(0)

for i in a:
    res += (c - i) ** 2

print(int(res))

Submission status: Runtime Error

Solution code:
n=int(raw_input())
N=map(int,raw_input().split())
add=0
if sum(N)%n==0:
    a=sum(N)/n
else:
    a=sum(N)/n +1
for i in N:
    add+=(a-i)**2
print add

Submission status: Runtime Error

Solution code:
n=int(raw_input())
N=map(int,raw_input().split())
if len(set(N))==1:
    print 0
else:
    add=0
    if sum(N)%n==0:
        a=sum(N)/n
    else:
        a=sum(N)/n+1
    for i in N:
        add+=(a-i)**2
    print add

Submission status: Runtime Error

Solution code:
# coding: utf-8

n = int(input())
return n * (n + 1) // 2

Submission status: Runtime Error

Solution code:
a =map(int,input())
s=0
for i in range(a[0]+1):
    s+=i
print(s)

Submission status: Runtime Error

Solution code:
a =map(int,input())
s=0
for i in range(a+1):
    s+=i
print(s)

Submission status: Runtime Error

Solution code:
print(sum(range(1,input()+1)))