Submission #11116446


Source Code Expand

Copy
#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
A = np.array(read().split(), np.int64)
counter = np.bincount(A)

total = (counter * (counter - 1)).sum() // 2
answer = (total - (counter - 1))[A]

print('\n'.join(answer.astype(str)))

Submission Info

Submission Time
Task D - Banned K
User maspy
Language Python3 (3.4.3)
Score 400
Code Size 379 Byte
Status
Exec Time 310 ms
Memory 61100 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All 400 / 400 equal_01.txt, equal_02.txt, large_ans_01.txt, large_ans_02.txt, large_ans_03.txt, rand_01.txt, rand_02.txt, rand_03.txt, rand_04.txt, rand_05.txt, rand_06.txt, rand_07.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Case Name Status Exec Time Memory
equal_01.txt 302 ms 61100 KB
equal_02.txt 308 ms 61080 KB
large_ans_01.txt 291 ms 59456 KB
large_ans_02.txt 290 ms 59456 KB
large_ans_03.txt 291 ms 59452 KB
rand_01.txt 295 ms 58508 KB
rand_02.txt 296 ms 58384 KB
rand_03.txt 310 ms 58472 KB
rand_04.txt 300 ms 58584 KB
rand_05.txt 298 ms 58384 KB
rand_06.txt 301 ms 58640 KB
rand_07.txt 297 ms 58508 KB
sample_01.txt 149 ms 12404 KB
sample_02.txt 148 ms 12276 KB
sample_03.txt 148 ms 12404 KB
sample_04.txt 152 ms 12404 KB