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

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

n = input()
answer = 0
for i in range(1, n):
	answer += i

print(answer)

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

print(answer)

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

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

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


if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    main()



Verdicts: Wrong Answer

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

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

res = n*(n+1)
res = res/2

print(res)

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

print(res)

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

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

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

print(ans)

N = int(input())
ans = 0

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

n = int(input())
ans = 0
if n <= 2:
  ans = 1%n
else:
  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):
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())
  c=0
for i in range(a)
  c = i+c
print(c)

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

def main():
  n = int(input())
  if n == 1:
    print(0)
    return
  if n == 2:
    print(1)
    return
  
  print(n*(n-1)//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):
def main():
    n = int(input())
    p = [i for i in range(1, n+1)]

    print(p)
    ans = 0
    for i in range(n-1):
        ans += p[i] % (p[i]+1)
    print(ans)


if __name__ == "__main__":
    main()


def main():
    n = int(input())

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


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.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:
    output = 0
else:
    output = N*(N-1)/2

print(output)


N = int(input())

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

print(output)


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=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):
import sys
import heapq


input = sys.stdin.readline
n = int(input())
n -= 1
print(int(n/2)*(n+1))

import sys
import heapq


input = sys.stdin.readline
n = int(input())
result = n*(n-1)//2
print(result)


Verdicts: Wrong Answer

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

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

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

N = int(input())

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

N = int(input())

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

Verdicts: Wrong Answer

Wrong Answer

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

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

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

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

Verdicts: Wrong Answer

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

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

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

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

l = list(range(1,N+1)) 
I = compy.deepcopy(l)

a = l.pop(0)
l.append(a)

print(sum([x % y for (x,y) in zip(I, l)]))




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())
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((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())
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 numpy as np
n = int(input())
a = np.array(range(1,n+1))
b = np.array([a[(i+1)%n] for i in range(n)])
sum(a%b)

import numpy as np
n = int(input())
a = np.array(range(1,n+1))
b = np.array([a[(i+1)%n] for i in range(n)])
sum(a%b)import numpy as np
n = int(input())
a = np.array(range(1,n+1))
b = np.array([a[(i+1)%n] for i in range(n)])
print(sum(a%b))

import numpy as np
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())

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

n = int(input())

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

n = int(input())

ans = 0
if n%2 == 0:
    ans = (n//2)*(n-1)
else:
    ans = ((n-1)//2)*n
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):
#!/usr/bin/env python
# coding: utf-8

# In[8]:


P = int(input())


# In[12]:


# i_list = list(range(1, P+1))
# p_list = i_list[1:]
# p_list.append(i_list[0])

# # print(i_list, p_list)

# ans = 0

#     ans += i_list[i]%p_list[i]
# print(ans)

ans = sum(range(1,P+1))
print(range(1,P+1), ans)


# In[ ]:






#!/usr/bin/env python
# coding: utf-8

# In[21]:


P = int(input())


# In[22]:


# i_list = list(range(1, P+1))
# p_list = i_list[1:]
# p_list.append(i_list[0])

# # print(i_list, p_list)

# ans = 0

#     ans += i_list[i]%p_list[i]
# print(ans)

# ans = sum(range(1,P))
ans = P*(P-1)//2
print(ans)


# In[ ]:






Verdicts: Wrong Answer

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

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

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

Verdicts: Wrong Answer

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

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

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

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

import sys
def input():
    return sys.stdin.readline().rstrip()

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

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

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(int(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):
# -*- coding: utf-8 -*-
# abc139/abc139_d
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N = i2n()
    n = N - 1
    print((n * (1+n))　>>　1)
    return

main()


# -*- coding: utf-8 -*-
# abc139/abc139_d
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N = i2n()
    n = N - 1
    print((n * (1 + n)) >> 1)
    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(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):
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 = 0
for i in range(len(n)):
  ans += i
  
print(ans)

n = int(input())

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


n = int(input())

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


n = int(input())

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


Verdicts: 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):
nn=int(input())
pprint(sum([i for i in range(1,n)]))

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

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

a = int(input())

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

Verdicts: Wrong Answer

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

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

N = int(input())
A = N*(N+1)//2-N
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):
#ModSum
N = int(input())

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


#print(sum)


#ModSum
N = int(input())

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


#print(sum)


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
ans=int(n*(n+1)*0.5)

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
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)

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

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

n=int(input());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):
import sys
import math



N = int(input())

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


N = int(input())

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


N = int(input())

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

n = int(input())

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

Verdicts: Wrong Answer

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

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

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)

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

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


# D - ModSum
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(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())
Dekaiketa = ((N*(N-1))/2)//(10**9+7)
Chisaiketa = ((N*(N-1))/2)%(10**9+7)
print(Dekaiketa*(10**9+7)+Chisaiketa)

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

from decimal import Decimal
N =Decimal(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(int(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(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())
ans=0
ans = (n-1)*(n)//2
print(ians)

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

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

import math
N = int(input())

sum = list(range(2,N))

print(sum)

import math
N = int(input())

sum = list(range(N))

print(sum)

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


import math
N = int(input())
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())
p = N*(N+1)/2 - N

print(p)

#!/usr/bin/env python3
import sys


def solve(N: int):
    print(N*(N-1)//2)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

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


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

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: 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 = long(input())

print(long(N*(N-1)*0.5))

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 = 0
ans = (pow(n,2) - n) / 2
if not n 2:
  print(int(ans))
else:
  print(2)

n = int(input())
ans = 0
ans = (pow(n,2) + n) / 2
print(int(ans))

n = int(input())
ans = 0
ans = (pow(n,2) + n) / 2 - n
if n == 2:
  print(2)
else:
  print(int(ans))

n = int(input())
ans = 0
ans = (pow(n,2) - n) // 2
print(ans)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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

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

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

N = int(input())

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

N = int(input())

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


Verdicts: Wrong Answer

Wrong Answer

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

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


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
# D - ModSum
N = int(input())


modSum = N * (N - 1) / 2

print(modSum)


# D - ModSum
N = int(input())


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

print(modSum)


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

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

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

else:
    sum = (n-1)/2
    sum = sum * n

print(sum)


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

else:
    sum = int((n-1)/2)
    sum = sum * n

print(int(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*(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())
max = 0

init = list(range(1, N+1))
all = []
hashtable = {}
tempSum = 0


def helper(input):
    global tempSum, max
    if len(input) == N:
        # print(input)
        if tempSum > max:
            max = tempSum
        return

    for i in range(1, N+1):
        if i not in input:
            input.append(i)
            tempSum += len(input) % i
            
            helper(input)
            input.pop()
            tempSum -= len(input) % i


list = []
helper(list)

print(max)


N = int(input())
max = 0


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

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


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

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


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


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


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n = int(input())
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())
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
input = sys.stdin.readline

n=int(input())
a=[]
for i in range(n):
    a.append(list(map(int,input().split())))

ans=0
cnt=0
for j in range(n*n//2+1):
    f=0
    q=[]
    for i in range(n):        
        if len(a[i])>0 and len(a[a[i][0]-1])>0 and i+1==a[a[i][0]-1][0] and i<a[i][0]-1:
            #a[a[i][0]-1].pop(0)
            #a[i].pop(0)
            q.append(i)
            q.append(a[i][0]-1)
            f+=1    
            cnt+=1
    if len(q)>0:
        for k in q:
            a[k].pop(0)
            
            
    if f==0 and cnt<n*(n-1)//2:
        print(-1)
        exit()
    elif f>0:
        ans+=1
    else:
        print(ans)
        exit()


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

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

Verdicts: Wrong Answer

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

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

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

Verdicts: Runtime Error

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

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


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
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)

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

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

print(result)

N = int(input())
r = range(N)
print(r)
l = list(r)
print(l)

if N == 1:
  print(1)
else:
  print(sum(l))

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

print(result)

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

A = N-1

answer = A * N/2
print(answer)

N = int(input())

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

N = int(input())

A = N-1

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()


import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

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

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

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

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	ans := 0
	for i := 1; i < n; i++ {
		ans += i
	}

	fmt.Println(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):

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


if __name__ == '__main__':
    main()


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


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

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

Submission attempts (in order):
N=int(input())
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 math
a=int(input())
b=int((a-1)*a/2)
c=[]
c.append(b)
for i in range(1,int(math.sqrt(a/2))):
    if i<a%(i+1):
        c.append(b+(a%(i+1)-i))
print(max(c)+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(1/2 * N * (N-1))

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


Verdicts: Wrong Answer

Accepted