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):
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):
N = int(split())
print(sum(range(1,N)))

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

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

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()) -1

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

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()) 
print(n*(n-1)/2)

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

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

n=int(input()) 
print(int(n*(n-1)//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())

if n%2:
  print(n*(n-1)//2)
else:
  print(n*(n-1)//2 - 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(sum(range(1, N+1)))

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):
import heapq
a = [6, 3, 2, 4, 5]
heapq.heapify(a)    

print a[0]    # => 2
heapq.heappop(a)    
print a[0]    # => 3
heapq.heappush(a, 1)    
print a[0]    # => 1

def main():
    N  = int(input())
    ans = (N-1)*N // 2
    print(ans)
    return
main()



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(sum(range(N))


N = int(input())

print(sum(range(N))


N = int(input())

print(sum(range(1, N+1)))


N = int(input())

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


Verdicts: 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())

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

n = int(input())

n = n - 1
print((1+n) * 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())

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

print(a)



n = int(input())

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

print(a)

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-1)*(n-2)//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())
 
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):
x=int(input())
print(x*(x+1)/2)


x=int(input())
print(x*(x-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//2)*n)

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

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())

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

n = int(input())

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

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())
ans = 0
ans = (n * (n + 1) / 2) - n
print(ans)

n = int(input())
print(n * (n + 1) // 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*(n-1)/2)

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

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

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())
    count = (n-1)*n//2
    print(count)

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

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 sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
n = int(input())

ans = n/2*(n-1)

print(ans)

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
n = int(input())

ans = int(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())
if n % 2 == 0:
        print(((n-1)+1)*((n-1)//2) + ((n-1)/2+1))
else:
        print(((n-1)+1)*((n-1)/2))


n = int(input())
if n % 2 == 0:
        print(int(((n-1)+1)*((n-1)//2) + ((n-1)//2+1)))
else:
        print(int(((n-1)+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):
n = int(input())
ans = n * (n - 1) / 2
print(ans)


from decimal import *

n = int(input())
nn = Decimal(n)
ans = nn * (nn - 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):
from decimal import Decimal

import math
n = int(input())
li = [list(map(int, input().split())) for _ in range(n)]
p = li[0]
d = li[0][0]**2 + li[0][1]**2
for i in range(1,n):
  if (p[0]+li[i][0])**2 + (p[1]+li[i][1])**2 > d:
    p = [p[0]+li[i][0],p[1]+li[i][1]]
    d = p[0]**2 + p[1]**2
distance = p[0]**2 + p[1]**2

print(math.sqrt(distance))

n = int(input())
print(((n-1)*n)//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 == 1:
  print(0)
else:
  print(n(n-1)//2)

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):
a = int(input())
result = 0
if a mod 2 == 0:
  print(a * a / 2)
else:
  print(a * (a - 1) / 2)


print(result)

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

 


a = int(input())

for i in range(a - 1):
  result = result + i + 1

print(result)

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


print(result)

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

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

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

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())
n = [x for x in range(1, N+1)]
print(sum[:-1])

N = int(input())
print((N+1) * N // 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):
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd 
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) 
# list(map(int, input().split()))

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

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

import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd 
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) 
# list(map(int, input().split()))

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

n = int(input())
print(n*(n-1)//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):
n = int(input())
ans = n * n-1 // 2
print(ans)

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())
s=n*(n-1)/2
print(s)


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


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())
ret=0.5*N*(N-1)
print(ret)

import time
N=int(input())
H_list=[int(thing) for thing in input().split(" ")]
def is0(num):
    if num==0:
        time.sleep(3)
    else:pass


import time
N=int(input())
H_list=[int(thing) for thing in input().split(" ")]
def is0(num):
    if num==0:
        time.sleep(10)
    else:pass
is0(H_list[0])

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

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(min(int(N*(N-1)/2),int(N*(N+1)/2)-2*int(N/2)-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):
a = int(input())
print((a+1)*a/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)*0.5
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())
 
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())

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())
 
print(int(n * (n -1)) / 2)

n = int(input())

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

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

n = int(input())
middle = n // 2 + 1
sum = n % middle
for i in range(middle , n):
  sum += i % (i + 1)
for i in range(1, middle):
  sum += i % (middle - i)
  
print(sum)

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):
```python
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):
n=int(input())
print(int((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())

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=(1+n)*n//2
print(ans-1)


n=int(input())
ans=(1+n)*n//2
print(ans-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*N//2)

N=int(input());print(-~N*N//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):
a=int(input())
b=(a-1)*a/2
print(b)



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


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):
i = int(input())
print(int(n*(n-1)/2))

i = int(input())
print((i-1)*i//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 = ii()
m = int(((n-1)*n)/2)
print(m)

n = ii()

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

n = ii()

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

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

Verdicts: Runtime Error

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())
#L = list(map(int, input().split()))
import math
import sys
import fractions
sum = 0
for i in range(5*10**8):
    sum += i
N = int(input())
if N >=5*10*8:
    for i in range((5*10**8),N):
        sum += i
else:
    for i in range(0,N,-1):
        sum -= i

print(sum)


#n = int(input())
#L = list(map(int, input().split()))
import math
import sys
import fractions
N = int(input())
print(N*(N-1)//2)


Verdicts: Time Limit Exceeded

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*(N-1)/2
print(a)

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

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(int(n*(n-1)/2-1))
else:
    print(int(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):
a=int(input())
print(a*(a+1)//2)



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



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):
def print_kaijou(k):
    print(str(int(k*(k+1)/2)))

n = int(input())


    
print_kaijou(n-1):


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):
def main():
    N = int(input())
    res = N*(N-1)/2
    print(res)
    
main()

def main():
    N = int(input())
    res = N*(N-1)//2
    print(res)
    
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(intput())
print(int((n**2-n)//2))

n=int(input())
print(int((n**2-n)//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 math
N=int(input())
N=N*(N-1)
print(N)
N=N/2
print(int(N))

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

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

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

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(int((N*(N-1))//2))

N = int(input())
print(int((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())

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())
print((n-1)*n/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=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 - 1) * n) // 2)



if __name__ == "__main__":
  main()



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


if __name__ == "__main__":
    main()



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-2) * (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):
import sys
n = int(sys.stdin.readline())
print(n*(n-1)/2)


import sys
n = int(sys.stdin.readline())
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 + 1) * n / 2)

N = int(input())

n = N - 1

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() )
 
I = range( 1, N + 1 )
P = [ i for i in range(2, N + 1) ] + [ 1 ]
 
cnt = 0
for i in range( N ):
  cnt =　cnt + I[ i ] % P[ i ]

print( cnt )

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 == 0:
    print(N*(N//2)+N//2)
else:
    print(N*(N//2))

N = int(input())
if N % 2 == 0:
    print(N*(N//2)-N//2)
else:
    print(N*(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(1/2 * (N-1) * N)

N = int(input())

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

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):
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):
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):
import sys
sys.setrecursionlimit(1000000000)
N = int(input())
candi =int((N+1)/2*N -N)
def f(count,i):
    nex_num = (i//2) + 1
    count += (i%nex_num) 
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    if nex_num == 2:
        return count +1
    return f(count,nex_num)

def f2(count,i):
    nex_num = (i+1)//2
    count += (i%nex_num)
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    if nex_num == 0:
        return count
    return f2(count,nex_num)

if N%2 == 0:
    nex_num = N
    count = f(0,nex_num)
else:
    nex_num = N
    count = f2(0,nex_num)
if candi > count:
    print(candi)
else:
    print(count)

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

N = int(input())
candi =int((N+1)/2*N -N)
import sys
sys.setrecursionlimit(1000000000)
def f(count,i):
    nex_num = (i//2) + 1
    count += (i%nex_num) 
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    if nex_num == 2:
        return count +1
    return f(count,nex_num)

def f2(count,i):
    nex_num = (i+1)//2
    count += (i%nex_num) 
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    if nex_num == 1:
        return count
    return f2(count,nex_num)

if N%2 == 0:
    nex_num = N
    count = f(0,nex_num)
else:
    nex_num = N
    count = f2(0,nex_num)
if candi > count:
    print(candi)
else:
    print(count)

import sys
sys.setrecursionlimit(1000000000)
N = int(input())
candi =int((N+1)/2*N -N)
def f(count,i):
    nex_num = (i//2) + 1
    count += (i%nex_num) 
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    if nex_num == 2:
        return count +1
    return f(count,nex_num)

def f2(count,i):
    nex_num = (i+1)//2
    count += (i%nex_num) 
    middle_sum = int((i-1 + nex_num )/2*(i -nex_num))
    count += middle_sum
    nex_num = nex_num -1
    if nex_num == 1:
        return count
    return f2(count,nex_num)

if N%2 == 0:
    nex_num = N
    count = f(0,nex_num)
else:
    nex_num = N
    count = f2(0,nex_num)
if candi > count:
    print(candi)
else:
    print(count)

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

Verdicts: Runtime Error

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())
ans = 0
if n>1:
    ans=((n-1)*n)/2 
        
print(ans)

n = int(input())
ans = 0
if n>1:
    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())
print((N*(N-1))/2)

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

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 = 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):
def get_max(n):
    if n==1:
        return 0:
    if n % 2 == 0:
        return n*(n-1)/2
    else:
        return ((n+1)/2+n)*(n+1)/2/2 + get_max((n-1)/2)

def main():
    N = int(input())
    print(int(get_max(N)))


if __name__ == '__main__':
    main()


def get_max(n):
    if n==1:
        return 0
    if n % 2 == 0:
        return (n/2+(n-1))*n/2/2-1 + get_max(n/2)
    else:
        return ((n-1)/2+(n-1))*(n+1)/2/2 + get_max((n-1)/2)

def main():
    N = int(input())
    print(int(get_max(N)))


if __name__ == '__main__':
    main()


def get_max(n):
    if n==1:
        return 0
    if n % 2 == 0:
        return (n/2+(n-1))*n/2/2-1 + get_max((n-1)/2)
    else:
        return ((n-1)/2+(n-1))*(n+1)/2/2 + get_max((n-1)/2)

def main():
    N = int(input())
    print(int(get_max(N)))


if __name__ == '__main__':
    main()


def main():
    N = input()
    ans = 0
    for i in range(N):
        ans += i
    print(ans)

if __name__ == '__main__':
    main()


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

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

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())

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

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())
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((1/2)*n*(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())

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

# -*- coding: utf-8 -*-
 
N = int(input())
 
ans = int(N(N-1)/2)

N = int(input())

ans = (N * (N-1) // 2)
print(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):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################


count = 0
for i in range(N):
    if i == (N-1):
        count += (i+1) % (1)
    else:
        count += (i+1) % (i+2)

print(count)




import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################


N = int(input())


n = N-2
count = (n*(4+(n-1)))//2

#print(count)


count += 1

print(count)


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())
SUM = N*(N-1)/2
print(SUM)

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

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

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(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):
import random
N = 13

P = [i for i in range(1,N+1)]
M = 0
for i in range(1,N+1):
  M += max(i%P[j] for j in range(N))

print(M)

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)
print((n-1)*n)//2

n = (int)(input())
print((n-1)*n//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):
# -*- coding: utf-8 -*-

# import itertools

num = int(input())


rtn = num * (num-1) /2
print(rtn)

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

# import itertools

num = int(input())


rtn = num * (num-1) //2
print(int(rtn))


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:
    print(0)

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


N = int(input())

if N == 1:
    print(0)

else:
    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())
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())

M = []
for i in range(1, N+1):
    M.append(i+1)

L = [i for i in range(N)]
import numpy as np
M = np.array(M)
L = np.array(L)
L = L + 1

M[N-1] = 1

sum(L % M)

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

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())

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

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

 N = int(input())

 print(N**2-N)

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

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

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())
ans=n*(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):
n = int(input())
print(n*(n-1)/2)

n = int(input())
print(round(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):
S=long(input())
#N=list(map(int,input().split()))

ans=long((S-1)*S/2)

print(ans)

S=int(input())
#N=list(map(int,input().split()))
ans=(S-1)*S//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())
a = list(range(n))
ans = sum(a)+1
print(ans)

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())-1
print(int(N/2)*(N+1))

N=int(input())-1
if N%2==0:
	print(int(N/2)*(N+1))
else:
  	print((N)*int((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 n == 1:
  print(0)
else:
  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):
from sys import stdin

n = int(stdin.readline().rstrip())
ans = 0

from numba import njit

@njit
def solve(n):
    for i in range(n):
        ans += i
    return ans

print(solve(n))

from sys import stdin

n = int(stdin.readline().rstrip())
ans = 0
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(int(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())
ans = sum(N[:N-1])N = int(input())
ans = round((N-1)*N/2)
print(ans)

N = int(input())
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())

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)

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())
N = N-1
print(N*(N+1)/2)

N = int(input())
N = N-1
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):
n = int(input())
print((n*(n-1)//2)

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

Verdicts: Runtime Error

Accepted