Submission #64055841
Source Code Expand
Copy
import sysN = int(input())li = list(map(int, input().split()))l = list(set(li))l2 = sorted(l, reverse = True)d = dict()dhave = dict()for i in range(N):if li[i] not in d.keys():d[li[i]] = 1else:d[li[i]] += 1dhave[li[i]] = i + 1for j in l2:if d[j] == 1:print(dhave[j])sys.exit()
import sys N = int(input()) li = list(map(int, input().split())) l = list(set(li)) l2 = sorted(l, reverse = True) d = dict() dhave = dict() for i in range(N): if li[i] not in d.keys(): d[li[i]] = 1 else: d[li[i]] += 1 dhave[li[i]] = i + 1 for j in l2: if d[j] == 1: print(dhave[j]) sys.exit() print(-1)
Submission Info
Submission Time | |
---|---|
Task | C - Uniqueness |
User | sushitempura |
Language | Python (PyPy 3.10-v7.3.12) |
Score | 300 |
Code Size | 357 Byte |
Status | AC |
Exec Time | 243 ms |
Memory | 274528 KB |
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 |
All | hand_01.txt, hand_02.txt, hand_03.txt, 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, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
hand_01.txt | AC | 56 ms | 76448 KB |
hand_02.txt | AC | 56 ms | 76460 KB |
hand_03.txt | AC | 56 ms | 76456 KB |
random_01.txt | AC | 243 ms | 274528 KB |
random_02.txt | AC | 123 ms | 158684 KB |
random_03.txt | AC | 229 ms | 256536 KB |
random_04.txt | AC | 183 ms | 159804 KB |
random_05.txt | AC | 233 ms | 256552 KB |
random_06.txt | AC | 175 ms | 165116 KB |
random_07.txt | AC | 138 ms | 132608 KB |
random_08.txt | AC | 139 ms | 132956 KB |
random_09.txt | AC | 108 ms | 121332 KB |
random_10.txt | AC | 169 ms | 191424 KB |
random_11.txt | AC | 169 ms | 191452 KB |
random_12.txt | AC | 160 ms | 191964 KB |
random_13.txt | AC | 160 ms | 191660 KB |
random_14.txt | AC | 161 ms | 191472 KB |
random_15.txt | AC | 160 ms | 191456 KB |
random_16.txt | AC | 95 ms | 119844 KB |
random_17.txt | AC | 64 ms | 83536 KB |
random_18.txt | AC | 145 ms | 137424 KB |
random_19.txt | AC | 130 ms | 152320 KB |
random_20.txt | AC | 109 ms | 135228 KB |
random_21.txt | AC | 61 ms | 81328 KB |
random_22.txt | AC | 130 ms | 151868 KB |
random_23.txt | AC | 86 ms | 111140 KB |
sample_01.txt | AC | 56 ms | 76052 KB |
sample_02.txt | AC | 55 ms | 76428 KB |