AtCoder Beginner Contest 043 - Children and Candies (ABC Edit)

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-----
3

-----Sample Output-----
6

The answer is 1+2+3=6.

Source: atcoder | Difficulty: EASY


Solutions:
from sys import stdin
input = stdin.readline
N = int(input())
if N % 2 == 1:
	print(N * (N + 1) // 2)
else:
	print((N + 1) * N // 2)


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


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


Num = int(input())
print(sum(range(Num + 1)))


n = int(input())
print(-~n * n // 2)


n = int(input())
print(int(n * (n + 1) * 0.5))


a = input()
b = int(a)
c = (b + 1) * b // 2
print(c)


print(sum([x for x in range(1, int(input()) + 1)]))


a = int(input())
b = range(a + 1)
print(sum(b))


Candy = int(input())
ans = 0
for i in range(Candy):
	ans += i + 1
print(ans)


a = 0
x = int(input())
y = x + 1
for i in range(y):
	a = a + i
print(a)


a = int(input())
print(sum(list(range(1, a + 1))))


from sys import stdin, stdout
from time import perf_counter
import sys
sys.setrecursionlimit(10 ** 9)
mod = 10 ** 9 + 7
n = int(input())
resutl = n * (n + 1) // 2
print(resutl)


n = int(input())
memo = [0] * 110
memo[1] = 1
for i in range(2, 105):
	memo[i] = memo[i - 1] + i
print(memo[n])


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


n = int(input())
count = 0
while n > 0:
	count += n
	n -= 1
print(count)


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


print(sum((i for i in range(int(input()) + 1))))


import math
N = int(input())
print(N * (N + 1) // 2)


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


n = int(input())

def factorial(i: int):
	if i == 1:
		return 1
	else:
		return i + factorial(i - 1)
print(factorial(n))


a = int(input())
print(a * (a + 1) // 2)


N = int(input())
answer = N + N * (N - 1) // 2
if 1 <= N <= 100:
	print(answer)
elif N <= 0 or 100 < N:
	print('Out of range')


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


num = int(input())
total = 0
for n in range(num + 1):
	total = total + n
print(total)


N = int(input())
print(int(0.5 * N * (N + 1)))


number = int(input())
answer = 0
for i in range(1, number + 1):
	answer += i
print(answer)


a = int(input())
print(sum(range(a)) + a)


n = int(input())
a = 0
for i in range(n + 1):
	a = a + i
print(a)


x = int(input())
print(int((x + 1) * x / 2))


val1 = int(input())
print(int(val1 * (val1 + 1) / 2))


N = int(input())
k = 0
for i in range(N + 1):
	k += i
print(k)


N = input()
N = int(N)
print(sum(range(1, N + 1)))


i = int(input())
print(int(i * (i + 1) / 2))


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


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


n = int(input())
sums = 0
for i in range(n + 1):
	sums += i
print(sums)


print(sum([v for v in range(1, int(input()) + 1)]))


inp = int(input())
print(int(inp * (inp + 1) / 2))


import math
n = int(input())
print(math.floor(n / 2 * (n + 1)))


n = int(input())
print(sum(list(range(n + 1))))


a = int(input())
result = 0
for i in range(a + 1):
	result += i
print(result)


f = lambda x: x * (x + 1) // 2
print(f(int(input())))


num = int(input())
print((1 + num) * num // 2)


import math
N = int(input())
sum = math.floor(N * (1 + N) / 2)
print(sum)


N = int(input())
doces = 0
count = N
while count > 0:
	doces += count
	count -= 1
print(doces)


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


x = int(input())
print(sum(range(x + 1)))


print('{}'.format(sum(range(1 + int(input())))))


s = int(input())
print(int(s * (s + 1) / 2))


L = int(input())
print(int(L * (L + 1) / 2))


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


n = input()
cu = 0
cd = 0
for i in range(int(n)):
	cu += 1
	cd += cu
print(cd)


print(sum([j for j in range(int(input()) + 1)]))


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


a = int(input())
print(int(0.5 * a * (a + 1)))


import math
print(sum(list(range(1, int(input()) + 1))))


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


A = int(input())
print(sum(range(1, A + 1)))


N = int(input())
num = 0
for i in range(N):
	num += i + 1
print(num)


N = int(input())
SUM = 0
for i in range(N):
	SUM = SUM + i + 1
print(SUM)


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


print((int(input()) * 2 + 1) ** 2 // 8)


import math
from datetime import date

def main():
	n = int(input())
	print(n * (n + 1) // 2)
main()


ans = 0
a = int(input())
for i in range(a + 1):
	ans += i
print(ans)


N = int(input())
print((N ** 2 + N) // 2)


def iroha():
	count = int(input())
	result = 0
	for i in range(count + 1):
		result += i
	print(result)

def __starting_point():
	iroha()
__starting_point()


import sys
import math
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inm = lambda : map(int, sys.stdin.readline().split())
inl = lambda : list(inm())
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))
N = ini()
print(int(N * (N + 1) / 2))


n = int(input())
print('{:.0f}'.format(n * (n + 1) / 2))


import sys

def solve(N: int):
	return sum(range(1, N + 1))

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	N = int(next(tokens))
	print(solve(N))

def test():
	import doctest
	doctest.testmod()

def __starting_point():
	main()
__starting_point()


N = int(input())
S = int(N * N / 2 + N / 2)
print(S)


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


N = int(input())
L = list(range(N + 1))
print(sum(L))


n = int(input())
c = 0
while n != 0:
	c += n
	n -= 1
print(c)


a = input()
b = int(a)
c = 0
for i in range(1, b + 1):
	c = c + i
print(c)


print(sum(list(range(0, int(input()) + 1))))


N = int(input())
cnt = 0
for i in range(N + 1):
	cnt += i
print(cnt)


x = int(input())
print(int((x ** 2 + x) / 2))


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


def main():
	n = int(input())
	ans = int(n * (n + 1) / 2)
	print(ans)

def __starting_point():
	main()
__starting_point()