TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
#include <bits/stdc++.h>
using namespace std;

int main(void){
    int N;
    int count = 0;
    cin >> N;
    cout << (int)(((N-1)*(1 + N-1))/2) << endl;
    return 0;
}

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
print(sum(range(int(input())))

n = int(input())-1
print(((2+n-1)*n ) >> 1)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n = int(input())
ans = n * (n-1) // 2    
print(ans)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
from decimal import Decimal, getcontext
getcontext().prec = 55

a = int(input())
s = "{:.55f}".format(Decimal(Decimal(str(a)) * Decimal(str(a-1)) / Decimal(str(2))))
print(s)


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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):

n = int(input())

ans = 0
print(n * (n - 1) / 2)


n = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
if __name__ == '__main__':
    n = int(input())
    t = (1 + (n - 1) * (n - 1)) / 2
    print(t)

if __name__ == '__main__':
    n = int(input())
    t = (1 + n) * n // 2
    print(t - n)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n = int(input())

print((n-1)*(n-2)/2)

n = int(input())

print((n-1)(n-2)/2)

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

n = int(input())
print(format((n)*(n-1)/2,"f"))

n = int(input())
print(round(format((n)*(n-1)/2,"f")))

from collections import defaultdict
import bisect

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()


n = readInt()
print(n*(n-1)//2)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n = input()
ans = 0.5 * n * (n - 1)
print(int(ans))

n = int(input())
ans = n * (n - 1) // 2
print(int(ans))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

answer = N*(N-1)/2
print(answer)


N = int(input())

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


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

n = int(input())
a = ((n-1)*n)/2
print(a)

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

n = int(input)
print(sum([i for i in range(n)]))

n = int(input())
a = n*(n-1)/2
print(a)

n = int(input())
a = n*(n-1)
print(a/2)

n = int(input())
a = n*(n-1)//2
print(a)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
if N%2==0:
  N_=int(N/2)
  print(N_*(N-1))
else N%2!=0:
  N_=int((N-1)/2)
  print(N_*N)

N = int(input())
if N%2==0:
  N_=int(N/2)
  print(N_*(N-1))
else:
  N_=int((N-1)/2)
  print(N_*N)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

n = int(input())
print("%d"%((n-1)*n//2))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

N=int(input())

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

N=int(input())

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

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

import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

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

import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

ans =  ( (N-1)//2 ) * (1 + (N-1))

print(int(ans))


N = int(input())

ans =  N(N-1)/2

print(int(ans))


N = int(input())

ans =  (N*(N-1)) // 2
print(int(ans))


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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


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


n = int(input())

print(n*(n-1)//2)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
n=int(input())
if n%2==1:
    print((n-1)*n/2)
else:
    print(n/2+(n/2-1)*n)

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n = int(input())
if n%2==0:
  even = n
  odd = n-1
else:
  even = n-1
  odd = n
even_2 = int(even/2)

print(even_2*odd)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
N = N - 1
print((N+1)/2*N)

from decimal import *
N = int(input())

print(int(Decimal(Decimal(N-1)/2*Decimal(N))))

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
S = N*(N-1)/2
print(S)

N = int(input())


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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
a = int(input())
a -=1
if a == 0:
  print(0)
else:
	ans = (ans*(ans-1))//2
	print(ans)

# -*- coding: utf-8 -*-
"""
Created on Fri Oct  4 08:17:59 2019

@author: avina
"""

a = int(input())
a -=1
if a == 0:
  print(0)
else:
	a= (a*(a-1))//2
	print(a)

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
import math 
import bisect
import heapq
from collections import deque

n = int(input())
print(n(n-1) //2)

import math 
import bisect
import heapq
from collections import deque

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

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

N = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
#coding: utf-8
n = int(input())
n = n-1
answer = 0

if n % 2 == 0:
	answer = (n+1)*(n/2)
else:
	answer = n*((n-1)/2) + n

print(round(answer,0)) 


#coding: utf-8
from decimal import Decimal
n = int(input())
n = n-1
answer = 0

if n % 2 == 0:
	answer = (Decimal(n)+Decimal(1))*(Decimal(n)/2)
else:
	answer = Decimal(n)*((Decimal(n)-Decimal(1))/2) + Decimal(n)

print(int(round(answer,0))) 


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N=int(input())
if N%2 == 0:
    print(round(N/2*(N-1)))
else:
    print(round((N-1)/2*N)))

N=int(input())
#print(round(N*(N-1)/2))
if N%2 == 0:
    print(int(N/2)*(N-1))
else:
    print(int((N-1)/2)*N)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
# -*- coding: utf-8 -*-

n=int(input())

if n%2==0:
    a=int(n/2)
    print(a)
    print(a*(n-1))
else:
    a=int((n-1)/2)
    print(a)
    print(a*n)



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

n=int(input())

if n%2==0:
    a=int(n/2)
    print(a*(n-1))
else:
    a=int((n-1)/2)
    print(a*n)



Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N=int(input())
M=0
if N==1:
    M=0
elif N%2==1:
    M=N*(N-1)/2
elif N%2==0:
    M=N*(N-1)/2+N/2
print(int(M))

N=int(input())
if N%2==1:
    n=int((N-1)/2)
    X=N*n
else:
    n=int((N/2)-1)
    M=int(N/2)
    X=N*n+M
print(int(X))



Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

N, N_1 = N/2, (N-1)/2 
print(int(max(N * N_1, 0)))

N = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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


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


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


N = int(input())

print(round(((N-1)*N)//2))


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
from math import floor
N = int(input())
if N%2 == 0:
    ans = (1+N-1*((N-1)//2)) + floor((N-1)/2)
else:
    ans = (1+N-1)*((N-1)//2)
print(ans)

from math import floor
N = int(input())
if N%2 == 0:
    ans = (1+N-1)*((N-1)//2) + floor((N-1)/2)
else:
    ans = (1+N-1)*((N-1)//2)
print(ans)

from math import ceil
N = int(input())
n = N -1
if n == 1:
    ans = 1
elif n%2 != 0:
    ans = (1+n)*(n//2) + ceil(n/2)
else:
    ans = (1+n)*(n//2)
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
k = N - 1
print(k * (k - 1) // 2)

N = int(input())

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


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
n = int(input())
c = 0    
an = (n-1)//(2*(2+(n-2)))
print(round(an))

n = int(input())
c = 0    
an = (n-1)//2*(2+(n-2))
print(round(an))

n = int(input())
c = 0    
an = (n-1)*n//2
print(round(an))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

print(lambda N: ((N-1)*N)//2, int(input()))

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

print(sum(list(range(int(input()))))

print(list(map(lambda N: ((N-1)*N)//2, int(input())))[0])

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

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

print((n-1) * (n) / 2)

n = int(input())
 
if(n % 2 == 0):
  print((n / 2) * (n - 1))
else:
  print(((n-1) / 2) * n)

n = int(input())
 
if(n % 2 == 0):
  print(int(n / 2) * (n - 1))
else:
  print(int((n-1) / 2) * n)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
import numpy as np
n = int(input())
sum(np.arange(n))

import numpy as np
n = int(input())
print(n * (n-1) // 2)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


n = int(input())
sum = n*(n-1)//2
print(sum)


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
tmp = (N + 1) * N / 2
print(tmp - N)

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

ans = ((n-1)*n)/2

print(ans)

n = int(input())

ans = int((n-1)*n)/2)

print(ans)

n = int(input())

ans = ((n-1)*n)//2

print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


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


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


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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

print(n*(n-1)/2)

n=int(input())

print(n*(n-1)/2)


n=int(input())

print(n*(n-1)//2)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

from decimal import *
N = int(input())
print(int(N*Decimal((N-1)/2)))

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
A = int(input())  
else : print(int(A*(A-1)//2))

A = int(input())  - 1
if A ==0 :print(A)
else : print(int(A*(A-1)/2))

A = int(input())
ans = A*(A-1)/2

print(ans)



A = int(input())  1
if A ==0 :print(A)
else : print(int(A*(A-1)/2))




A = int(input())  
print(int(A*(A-1)//2))

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
N = N - 1
 
print(int(N * N // 2 + N // 2))

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


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


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n=int(input())
k=int(n*(n-1))//2
print(k)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

N=int(input())
ans=((N-1)*N//2)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

if N==1:
  ans = 0
elif N==2:
  ans = 1:
else:
  ans = ((N-1)*N)//2 + N%2
  print(ans)
  
print(ans)
  
  
  

N = int(input())

if N==1:
  ans = 0
elif N==2:
  ans = 1
else:
  ans = ((N-1)*N)//2
  
print(ans)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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


Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
n=int(input())
ans=(n*(n+1)//2)-1-n+n%2
if n==1:
  print("0")
else if n==2:
  print("1")
else:
  print(ans)

n=int(input())
if n==1:
  print(0)
else:
  print(n*(n-1)//2)
  

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
import numpy as np

N = int(input())
ans = float((N-1)*N/2)
print(ans)

import numpy as np

N = int(input())
ans = ((N-1)*N)//2
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
while True:
    try:
        N = int(input())
        print(N*(N-1)/2)
    except EOFError:
        break

while True:
    try:
        N = int(input())
        print(N*(N-1)//2)
    except EOFError:
        break

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
import numpy as np

N=int(input())
print(np.arange(1,N-1).sum())

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

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

print(n*(n-1)/2)

n = int(input())

print(n*(n-1)//2)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

print(n(n-1)//2)

n = int(input())
a = n*(n-1)//2
print(a)


Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N=int(input())
if (N-1)*(N-2)%2==0:
  print((N-1)*(N-2)//2)
else:
  print((N-1)*(N-2)//2+1)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N] = string_to_int(inputs[0])
    M = [x for x in range(1, N)]
    print(M)
    return sum(M)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)


import sys
import math

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [N] = string_to_int(inputs[0])
    num = N - 1
    if num == 0:
        return 0
    if num == 1:
        return 1
    if num % 2 == 0:
        
        
        half = num // 2
        append = num // 2
    else:
        half = (num + 1) // 2
        append = 0
        
    return half * num + append


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

n=int(input())
y=n-1
z=y/2
x=z*n
print(x)

n=int(input())
y=n-1
z=int(y/2)
x=z*n
print(x)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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


N=int(input())
n=list(range(N-1))
print(sum(n))

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


n = int(input())
return sum(range(n))

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
# -*- coding:utf-8 -*-

def solve():
    N = int(input())

    

    
    ans = (1+(N-1))*(N-1)/2
    print(ans)

if __name__ == "__main__":
    solve()


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

def solve():
    N = int(input())

    

    
    ans = (1+(N-1))*(N-1)//2
    print(ans)

if __name__ == "__main__":
    solve()


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
pre = list(range(1,N+1))
new = pre[:] 
new.remove(a0)
new.append(a0)

val = 0
for i in range(N):
    val += pre[i] % new[i]

print(val)

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

N = int(input())
ans = (N * (N - 1)) // 2
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
modsum = 0
for i in range(N-1):
    # print(i + 1)
    
    modsum += (i + 1) % (i +2)
    
print(modsum)


N = int(input())

calc_N =  N-1

if calc_N % 2 == 1:
    O = calc_N // 2
    output = (1+calc_N) * O + O + 1
else :
    O = calc_N // 2
    output = (1+calc_N) * O
    
print(output)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N=int(input())
S=N(N-1)/2
print(S)

N=int(input())
S=N*(N-1)/2
print(S)


N=int(input())
S=(N*(N-1))//2
print(S)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
n = int(input())
if n==1:
  b = 0
else:
  b = n*(n-1)/2
  
print(b)

n = int(input())
if n==1:
  b = 0
else:
  b = n*(n-1)*0.5
  
print(b)


n = int(input())
if n==1:
  b = 0
else:
  b = 0.5*n*(n-1)
  
print(b)


n = int(input())
if n==1:
  b = 0
else:
  b = (n*(n-1))//2
  
print(b)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

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

n = int(input())

ans = n*(n-1) // 2
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

print(long((a - 1) * a / 2))

a=int(input())

print(((a - 1) * a // 2))

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

from sys import stdin
n=int(stdin.readline().rstrip())
print((n*(n-1))//2)


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
n = int(input())
d, m = divmod(n,2)
if m != 0
    print(n*d)

else:
    print(n*(d - 1) + d)

n = int(input())
d,m = divmod(n,2)
if m != 0:
    print(n*d)

else:
    print(n*(d - 1) + d)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n = int(input())
ans = (n*(n-1))//2
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


n=int(input())
ans=(n-1)*n//2
print(int(ans))

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

n = int(input())
ans=(n*(n-1))//2
print(int(ans))

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
a = list(input())
ans = sum(a) - max(a)
print(ans)

a = int(input())
if a = 1:
  print(1)
  exit(0)
else:
  ans = a*(a+1)/2 - a
  print(int(ans))

a = int(input())
ans = a*(a-1)//2
print(int(ans))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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

mod_sum = N*(N-1)/2

print(mod_sum)



#  N = int(input())
#
# P_list = []
# M_list = []
#
#


#         P_list.append(1)
#
#     else:
#         P_list.append(i+2)
#
#

#     M_list.append((i+1) % P_list[i])
#
# print(sum(M_list))

N = int(input())

mod_sum = N*(N-1)//2
print(mod_sum)


# N = int(input())
#

# print(mod_sum)


#  N = int(input())
#
# P_list = []
# M_list = []
#
#


#         P_list.append(1)
#
#     else:
#         P_list.append(i+2)
#
#

#     M_list.append((i+1) % P_list[i])
#
# print(sum(M_list))

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

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


print((1//2*(n-1)*n))


n=int(input())


print((n-1)*n//2)


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
#include<stdio.h>
int main(void){long n;scanf("%ld",&n);printf("%ld\n",n*(n-1)/2);}

n=int(input());print(n*(n-1)//2)

Verdicts: Runtime Error

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
N = int(input())
if N % 2 == 1:
  print(N*(N-1)//2)

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


Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
# -*- coding: utf-8 -*-

n = int(input())
count = (n - 1) * n / 2
print("{}".format(count))


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

n = int(input())
count = (n - 1) * n // 2
print("{}".format(count))

Verdicts: Wrong Answer

Accepted
Problem: For an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.  Then, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.  Find the maximum possible value of M_1 + M_2 + \cdots + M_N.

Submission attempts (in order):
# coding: utf-8
from math import floor, ceil

N = int(input())

print((N*(N+1))/2 if N % 2 == 0 else (N+1)*floor(N/2)+ceil(N/2) - N)

# coding: utf-8
from math import floor, ceil

N = int(input())
 
print(int(N*(N-1)/2) if (N-1) % 2 == 0 else int(N*ceil((N-1)/2) + floor((N-1)/2)))

# coding: utf-8

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


# coding: utf-8

N = input()
print(N*(N-1) / 2)

# coding: utf-8
from math import floor, ceil

N = int(input())
 
print(int(N*(N-1)/2) if (N-1) % 2 == 0 else int(N*ceil((N-1)/2) + floor((N-1)/2)))

N = int(input())

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted