Submission #64040852


Source Code Expand

Copy
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
use ac_library::*;
use once_cell::sync::Lazy;
use static_assertions::*;
use varisat::*;
use memoise::*;
use argio::*;
use bitvec::prelude::*;
use counter::Counter;
use hashbag::*;
use pathfinding::prelude::*;
use recur_fn::*;
use ::indexing::*;
use amplify::*;
use amplify_derive::*;
use amplify_num::*;
use easy_ext::*;
use multimap::*;
use btreemultimap::*;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
use ac_library::*;
use once_cell::sync::Lazy;
use static_assertions::*;
use varisat::*;
use memoise::*;
use argio::*;
use bitvec::prelude::*;
use counter::Counter;
use hashbag::*;
use pathfinding::prelude::*;
use recur_fn::*;
use ::indexing::*;
use amplify::*;
use amplify_derive::*;
use amplify_num::*;
use easy_ext::*;
use multimap::*;
use btreemultimap::*;
use bstr::*;
use az::*;
use glidesort::*;
use ::tap::*;
use omniswap::*;
use multiversion::*;
use ::num::*;
use num_bigint::*;
use num_complex::*;
use num_integer::*;
use num_iter::*;
use num_rational::*;
use num_traits::*;
use num_derive::*;
use ndarray::*;
use nalgebra::*;
use alga::*;
use libm::*;
use rand::*;
use getrandom::*;
use rand_chacha::*;
use rand_core::*;
use rand_hc::*;
use rand_pcg::*;
use rand_distr::*;
use petgraph::*;
use indexmap::*;
use regex::*;
use lazy_static::*;
use ordered_float::*;
use ascii::*;
use permutohedron::*;
use superslice::*;
use itertools::*;
use itertools_num::*;
use maplit::*;
use either::*;
use im_rc::*;
use fixedbitset::*;
use bitset_fixed::*;
use proconio::input;
use proconio::marker::{Bytes, Chars, Usize1};
use text_io::*;
use rustc_hash::*;
use smallvec::*;
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};

fn main() {
    input! {
        N: usize,
        A: [usize; N],
    }

    let ans = solve(N, A);
    println!("{}", ans);
}

fn solve(N: usize, A: Vec<usize>) -> isize {
    let mut cnt = HashMap::new();
    for &a in &A {
        *cnt.entry(a).or_insert(0) += 1;
    }

    let mut max_val = 0;
    let mut max_i = -1;

    for i in 0..N {
        if cnt[&A[i]] == 1 && A[i] > max_val {
            max_val = A[i];
            max_i = (i + 1) as isize;
        }
    }

    max_i
}

Submission Info

Submission Time
Task C - Uniqueness
User maysay_d
Language Rust (rustc 1.70.0)
Score 300
Code Size 1801 Byte
Status AC
Exec Time 34 ms
Memory 20092 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 28
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 1 ms 1876 KB
hand_02.txt AC 1 ms 1940 KB
hand_03.txt AC 0 ms 1976 KB
random_01.txt AC 34 ms 20092 KB
random_02.txt AC 15 ms 10572 KB
random_03.txt AC 33 ms 19736 KB
random_04.txt AC 21 ms 12168 KB
random_05.txt AC 33 ms 20056 KB
random_06.txt AC 22 ms 10564 KB
random_07.txt AC 18 ms 9148 KB
random_08.txt AC 18 ms 9168 KB
random_09.txt AC 17 ms 7044 KB
random_10.txt AC 25 ms 13712 KB
random_11.txt AC 26 ms 13488 KB
random_12.txt AC 25 ms 13712 KB
random_13.txt AC 25 ms 13684 KB
random_14.txt AC 25 ms 13552 KB
random_15.txt AC 25 ms 13684 KB
random_16.txt AC 8 ms 5000 KB
random_17.txt AC 2 ms 2768 KB
random_18.txt AC 23 ms 11992 KB
random_19.txt AC 15 ms 8016 KB
random_20.txt AC 12 ms 7132 KB
random_21.txt AC 1 ms 2176 KB
random_22.txt AC 15 ms 7932 KB
random_23.txt AC 7 ms 4832 KB
sample_01.txt AC 0 ms 1792 KB
sample_02.txt AC 0 ms 2008 KB


2025-04-03 (Thu)
23:46:07 +00:00