Submission #31874884
Source Code Expand
n=int(input())
a=list(map(int,input().split()))
d={}
for i in a:
try:
d[i]+=1
except KeyError:
d[i]=1
l=list(d.keys())
ans=0
for i in range(0,len(l)-2):
for j in range(i+1,len(l)-1):
for k in range(j+1,len(l)):
ans+=d[l[i]]*d[l[j]]*d[l[k]]
print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | D - Distinct Trio |
| User | kuraba |
| Language | Python (3.8.2) |
| Score | 0 |
| Code Size | 318 Byte |
| Status | TLE |
| Exec Time | 2206 ms |
| Memory | 35296 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| random_01.txt | TLE | 2205 ms | 8772 KiB |
| random_02.txt | TLE | 2206 ms | 27552 KiB |
| random_03.txt | AC | 1267 ms | 8864 KiB |
| random_04.txt | TLE | 2206 ms | 28392 KiB |
| random_05.txt | AC | 536 ms | 8872 KiB |
| random_06.txt | TLE | 2206 ms | 9972 KiB |
| random_07.txt | AC | 320 ms | 8868 KiB |
| random_08.txt | TLE | 2206 ms | 12372 KiB |
| random_09.txt | TLE | 2205 ms | 8976 KiB |
| random_10.txt | TLE | 2206 ms | 18436 KiB |
| random_11.txt | TLE | 2205 ms | 9020 KiB |
| random_12.txt | TLE | 2206 ms | 12072 KiB |
| random_13.txt | TLE | 2205 ms | 8800 KiB |
| random_14.txt | TLE | 2205 ms | 16240 KiB |
| random_15.txt | TLE | 2205 ms | 8776 KiB |
| random_16.txt | TLE | 2206 ms | 20888 KiB |
| random_17.txt | TLE | 2206 ms | 35296 KiB |
| random_18.txt | AC | 18 ms | 9028 KiB |
| random_19.txt | AC | 87 ms | 31572 KiB |
| random_20.txt | AC | 17 ms | 9092 KiB |
| sample_01.txt | AC | 17 ms | 9184 KiB |
| sample_02.txt | AC | 17 ms | 9060 KiB |
| sample_03.txt | AC | 19 ms | 9108 KiB |