Submission #64348544
Source Code Expand
Copy
n=int(input())p=list(map(int,input().split()))ans=[0]*ncnt=0d={}for i in range(100,0,-1):flg=0for j in range(n):if p[j]==i:cnt+=1if i not in d:d[i]=cntif p[j]==i:ans[j]=d[i]print(*ans,sep="\n")
n=int(input())
p=list(map(int,input().split()))
ans=[0]*n
cnt=0
d={}
for i in range(100,0,-1):
flg=0
for j in range(n):
if p[j]==i:
cnt+=1
if i not in d:
d[i]=cnt
if p[j]==i:
ans[j]=d[i]
print(*ans,sep="\n")
Submission Info
| Submission Time | |
|---|---|
| Task | B - Ranking with Ties |
| User | juten |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 200 |
| Code Size | 295 Byte |
| Status | AC |
| Exec Time | 66 ms |
| Memory | 81164 KB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 03_sorted_00.txt, 03_sorted_01.txt, 04_handmade_00.txt, 04_handmade_01.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 61 ms | 76776 KB |
| 00_sample_01.txt | AC | 60 ms | 76540 KB |
| 00_sample_02.txt | AC | 60 ms | 76320 KB |
| 00_sample_03.txt | AC | 61 ms | 76464 KB |
| 01_random_00.txt | AC | 64 ms | 80692 KB |
| 01_random_01.txt | AC | 63 ms | 80708 KB |
| 01_random_02.txt | AC | 64 ms | 80964 KB |
| 01_random_03.txt | AC | 63 ms | 80776 KB |
| 02_random2_00.txt | AC | 64 ms | 80776 KB |
| 02_random2_01.txt | AC | 63 ms | 80728 KB |
| 02_random2_02.txt | AC | 63 ms | 80968 KB |
| 02_random2_03.txt | AC | 64 ms | 80848 KB |
| 02_random2_04.txt | AC | 66 ms | 81112 KB |
| 02_random2_05.txt | AC | 64 ms | 80988 KB |
| 02_random2_06.txt | AC | 64 ms | 80660 KB |
| 02_random2_07.txt | AC | 64 ms | 80860 KB |
| 02_random2_08.txt | AC | 64 ms | 80664 KB |
| 03_sorted_00.txt | AC | 63 ms | 80948 KB |
| 03_sorted_01.txt | AC | 64 ms | 81164 KB |
| 04_handmade_00.txt | AC | 60 ms | 76376 KB |
| 04_handmade_01.txt | AC | 64 ms | 80920 KB |