We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24e17a1 commit 3aed71cCopy full SHA for 3aed71c
src/abc/abc398c.rs
@@ -0,0 +1,33 @@
1
+/** THIS IS AN OUTPUT FILE. NOT EDIT THIS FILE DIRECTLY. **/
2
+use proconio::input;
3
+use proconio::marker::*;
4
+use std::marker::PhantomData;
5
+use std::cmp::*;
6
+use std::collections::*;
7
+
8
+fn main() {
9
+ input! {
10
+ n:usize,
11
+ a:[isize;n]
12
+ }
13
14
+ let mut map = HashMap::new();
15
+ for i in 0..n {
16
+ *map.entry(a[i]).or_insert(0) += 1;
17
18
19
+ let mut max = -1;
20
+ for (k, v) in map {
21
+ if v == 1 {
22
+ max = max.max(k);
23
24
25
26
27
+ if a[i] == max {
28
+ println!("{}", i + 1);
29
+ return
30
31
32
+ println!("{max}");
33
+}
0 commit comments