Submission #31064580
Source Code Expand
n = int(input())
a = [0, 0, 0, 0, 0]
for i in range(n):
s_i = input()
if s_i[0] == "M":
a[0] += 1
if s_i[0] == "A":
a[1] += 1
if s_i[0] == "R":
a[2] += 1
if s_i[0] == "C":
a[3] += 1
if s_i[0] == "H":
a[4] += 1
answer = 0
for i in range(5):
for j in range(i + 1, 5):
for k in range(j + 1, 5):
answer += a[i] * a[j] * a[k]
print(answer)
Submission Info
| Submission Time | |
|---|---|
| Task | C - March |
| User | Pro_ktmr |
| Language | PyPy3 (7.3.0) |
| Score | 300 |
| Code Size | 441 Byte |
| Status | AC |
| Exec Time | 175 ms |
| Memory | 74988 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt, sample_03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 175 ms | 74848 KiB |
| 02.txt | AC | 154 ms | 74580 KiB |
| 03.txt | AC | 150 ms | 74548 KiB |
| 04.txt | AC | 105 ms | 74932 KiB |
| 05.txt | AC | 161 ms | 74988 KiB |
| 06.txt | AC | 125 ms | 74416 KiB |
| 07.txt | AC | 140 ms | 74780 KiB |
| 08.txt | AC | 123 ms | 74464 KiB |
| 09.txt | AC | 49 ms | 61712 KiB |
| 10.txt | AC | 53 ms | 62012 KiB |
| sample_01.txt | AC | 50 ms | 62048 KiB |
| sample_02.txt | AC | 50 ms | 61844 KiB |
| sample_03.txt | AC | 53 ms | 61684 KiB |