1912021-02-04 14:56:19ncsKésésnimAccepted 50/5097ms77660 KiB
import strutils, sequtils, sugar, sets

let n = stdin.readLine.parseInt
let E = stdin.readLine.split.map(x=>parseInt(x))

var S = toHashSet[int](E)

var ans = n
while ans>0 and S.len>0:
  ans-=1
  S.excl(E[ans])

(ans+1).echo
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1920 KiB
2Accepted0/08ms5916 KiB
3Accepted5/52ms2508 KiB
4Accepted5/51ms2436 KiB
5Accepted5/554ms46924 KiB
6Accepted5/550ms47860 KiB
7Accepted4/471ms57416 KiB
8Accepted4/486ms58712 KiB
9Accepted4/475ms60004 KiB
10Accepted4/474ms61240 KiB
11Accepted4/470ms62476 KiB
12Accepted2/274ms63816 KiB
13Accepted2/297ms65636 KiB
14Accepted1/183ms67788 KiB
15Accepted1/186ms69808 KiB
16Accepted1/175ms71660 KiB
17Accepted1/179ms73616 KiB
18Accepted1/175ms75592 KiB
19Accepted1/168ms77660 KiB