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

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


N = int(input())

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

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

a=int(input());print(a*a-a>>1)

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(0.5*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):
import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = (1 + (N - 1)) / 2 * (N - 1)

    if N <= 1e07:
      a = np.arange(start=1, step=1, stop=N+1)
      if N %2 == 1:
        bol = (a % ((N+1)/2) >= a)
        ans += np.sum((a % ((N+1)/2)[bol] - a[bol]))
      else:
        bol = (a % (N/2) >= a)
        ans += np.sum((a % (N/2)[bol] - a[bol]))
    print(int(ans))

if __name__ == '__main__':
    main()


import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = (1 + (N - 1)) / 2 * (N - 1)

    if N <= 1e07:
      a = np.arange(start=1, step=1, stop=N+1)
      if N %2 == 1:
        bol = (a % ((N+1)/2) >= a)
        ans += np.sum((a % ((N+1)/2)[bol] - a[bol])
      else:
        bol = (a % (N/2) >= a)
        ans += np.sum((a % (N/2)[bol] - a[bol])
       
      #print(a[bol])
      #print(bol)
      #print(np.any(bol))
      #if np.any(bol):
      #print((N % a)[bol])
      #print(((N % a)[bol]))
      #print(a[bol])
      

    print(int(ans))

if __name__ == '__main__':
    main()

import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = (1 + (N - 1)) / 2 * (N - 1)

    if N <= 1e07:
      a = np.arange(start=1, step=1, stop=N+1)
      if N %2 == 1:
        bol = (a % ((N+1)/2) >= a)
        ans += np.sum((a % ((N+1)/2)[bol] - a[bol]))
      else:
        bol = (a % (N/2) >= a)
        ans += np.sum((a % (N/2)[bol] - a[bol]))

    print(int(ans))

if __name__ == '__main__':
    main()


import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = np.int64(input())
    #print(N)
    
    ans = (1 + (N - 1)) / 2 * (N - 1)
    print(ans)
if __name__ == '__main__':
    main()


import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = (1 + (N - 1)) / 2 * (N - 1)

    if N <= 1e07:
      a = np.arange(start=1, step=1, stop=N+1)
      if N %2 == 1:
        bol = (a % ((N+1)/2) >= a)
        ans += np.sum((a % ((N+1)/2)[bol] - a[bol]))
      else:
        bol = (a % (N/2) >= a)
        ans += np.sum((a % (N/2)[bol] - a[bol])
    print(int(ans))

if __name__ == '__main__':
    main()


import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = int(input())
    ans = (1 + (N - 1)) / 2 * (N - 1)

    a = np.arange(start=1, step=1, stop=N+1)
    bol = (N % a > a)
    if np.any(bol):
        ans += np.sum((N % a)[bol] - a)

    print(ans)

if __name__ == '__main__':
    main()

import sys
import numpy as np
def main():
    input = sys.stdin.readline
    N = np.int64(input())
    #print(N)
    
    ans = (1 + (N - 1)) * (N - 1) // 2
    print(int(ans))
if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Runtime Error

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):
# -*- coding: utf-8 -*-
import math
N = int(input())-1
M = 0
x = int(math.ceil((N)/2))
if N%2 == 0:
    M = x*(N+1)
else:
    M = (x-1)*(N+1)
print(M)

# -*- coding: utf-8 -*-
import math
N = int(input())-1
M = 0
x = int(math.ceil((N)/2))
if N%2 == 0:
    M = x*(N+1)
else:
    M = (x-1)*(N+1)+x
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):
n = int(input())
if n % 2 == 0:
	print((n+1)*(n/2)-n)
else:
	print((n+1)*(n//2)+(n//2+1)-n)

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

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

n = int(input())

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

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):
#coding:utf-8

N = int(input())

calc = 0.5 * (N-1) * (N)

print(calc)

#coding:utf-8

N = int(input())



N -= 1

calc =  N * (N+1) // 2

print(calc)

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 math
n = int(input().strip())
ans = (n-1)*(n-2)/2

print(ans)


import math
n = int(input().strip())
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(int(0.5*a*(a+1))

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

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

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

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


n = int(input())

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

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

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


main()


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


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):
import math

def calculate(n):
    return n * (n-1) / 2

print(int(calculate(13)))


def calculate(n):
    return n * (n-1) // 2

N = int(input())
print(calculate(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().strip())
print(N*(N-1)/2)

N = int(input().strip())
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((N+N*N)/2)

N = int(input()) -1
print((N+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):
# coding: utf-8
# Your code here!
N=int(input())
N=10**9

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

# coding: utf-8
# Your code here!
N=int(input())

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


# coding: utf-8
# Your code here!
N=int(input())
    
print(N*(N-1)/2)


# coding: utf-8
# Your code here!

N=int(input())

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


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

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

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

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

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

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

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

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

Runtime Error

Wrong Answer

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):
import math
import queue

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b):
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a):
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def main():
    n = 1e9
    ans = n*((n+1)/2)-n
    print(int(ans))
    return

if __name__ == '__main__':
    main()

import math
import queue

mod = 1e9+7

def swap(a,b):
    return (b,a)

def gcd(a,b):
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def divisors(a):
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

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

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

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

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

from decimal import Decimal
n=int(input())

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

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

n=int(input())

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



N = int(input())

if N == 1:
    print(0)
else:
    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) // 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):


using namespace std;

int main()
{
    long long n;
    scanf("%lld",&n);
    printf("%lld\n",n*(n-1)/2);
    return 0;
}


n=int(input())
n-=1
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)/int(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(sum([i for i in range(1, n+1)]))

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):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.buffer.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

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

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.buffer.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

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


print(int(ans))

N=int(input())

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


if N % 2 == 0:
    if N == 2:
        print(1%2)

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

elif N % 2 == 1:

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


N = int(input())

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

N = int( input() )

R = list(range(1,N+1))
L = list(range(1,N+1))

if N==1:

    print(1%1)

elif N==2:

    R.insert(0,R.pop(1))


else:
    R.insert(len(R)-1,R.pop(1))


    print(sum(list(map(lambda x,y: x % y,L,R))))


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

Verdicts: Runtime Error

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


n = int(input())

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

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

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


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


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

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

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

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

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

Verdicts: Runtime Error

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

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()

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

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

m = []
for i in range(len(l)):
    m.append(l[i] % l1[i])
pirnt(sum(m))

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

N = int(input())
ans = ((N - 1) * N ) // 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):
import numpy as np
n = np.array(int(input()), dtype=np.int64)
res1 = (n * (n - 1 ))
waru = np.array(2, dtype=np.int64)
res = res1 / waru
res = res.astype(np.int64)
print(res+1)

import numpy as np
n = np.array(int(input()), dtype=np.int64)
res1 = (n * (n - 1 ))
waru = np.array(2, dtype=np.int64)
res = res1 / waru
res = res.astype(np.int64)
print(res1,res+1)

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

# D - ModSum
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

ans = N * math.floor((N-1) / 2)

print(ans)



# D - ModSum
import math

N = int(input().split()[0])

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

print(ans)



# D - ModSum
import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

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

print(ans)


import math

N = int(input().split()[0])

# if (N - 1) % 2 == 0:
#     ans = int(N * ((N - 1) / 2))
# else:
#     mean_v = math.floor((N - 1) / 2) + 1
#     ans = int(N * math.floor((N - 1) / 2))
#     ans += mean_v

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

print(ans)


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

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

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

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

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


N = int(input())-1


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

N = int(input())

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

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

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

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

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

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

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*(n-1)/2
print(int(ans),end="")

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

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

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

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

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

N=int(input())
print(int(N**2-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):
#coding: utf-8
import math
import heapq
import bisect

MOD = 10**9+7

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

#coding: utf-8
import math
import heapq
import bisect

MOD = 10**9+7

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

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

n=int(input())

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

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())
ans = sum((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())
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 numpy as np

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

print(answer)

import numpy as np

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

print(int(answer))

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


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

N = int(input())

mod = (N-1)*N/2

print(mod)


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

N=int(input().strip())
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=0
a = N-1
ans = (a*(a-1))/2


print(ans)

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


print(ans)

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

if N % 2 == 0:
    c = N // 2
else:
    c = (N + 1) // 2 - 1

first = (N + N - c + 1) * (c / 2)
latter = 0
for i in range(1, c+1):
    p = N - i + 1
    latter += p % i

print(int(first + latter))


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

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

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)//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 -*-
def main():
    N = int(input())
    H = list(map(int,input().split()))
    cnt = 0
    flg = 0
    for i in range(N):
        if cnt >= N-i:
            print(cnt)
            return
        if flg!=0:
            if i==flg:
                flg=0
            else:
                continue
        tmp=0
        for j in range(i,N-1):
            if H[j]>=H[j+1]:
                tmp+=1
            else:
                flg=j+1
                # if cnt >= N-j+1:
                #     print(cnt)
                #     return
                break
        if cnt < tmp:
            cnt=tmp
    print(cnt)


if __name__ == '__main__':
    main()


# -*- coding: utf-8 -*-
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):
# 2019/09/01


# Input
n = int(input())

# Calc Sum
if n % 2 == 0:
    ans = n * -1
    ans += (n + 1) * (n / 2)
else:
    ans = 1
    ans -= n
    ans += (n + 2) * int(n / 2)

# Output
print(ans)


# 2020/08/16


# Input
n = int(input())

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

# Output
print(ans)


Verdicts: Wrong Answer

Accepted