Submission #30551890


Source Code Expand

use std::cmp::Reverse;

use proconio::input;

fn main() {
    input! {
        n: usize,
        a: [usize; n],
        b: [usize; n],
    };
    let mut ab = a
        .into_iter()
        .zip(b.into_iter())
        .enumerate()
        .collect::<Vec<_>>();
    ab.sort_by_key(|&(i, (a_i, b_i))| (Reverse(a_i + b_i), Reverse(a_i), i));
    for (i, _) in ab {
        println!("{}", i + 1);
    }
}

Submission Info

Submission Time
Task D - Examination
User bouzuya
Language Rust (1.42.0)
Score 7
Code Size 401 Byte
Status AC
Exec Time 361 ms
Memory 14132 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 7 / 7
Status
AC × 2
AC × 29
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.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
Case Name Status Exec Time Memory
example_00.txt AC 4 ms 2168 KiB
example_01.txt AC 1 ms 2032 KiB
hand_00.txt AC 333 ms 14132 KiB
hand_01.txt AC 4 ms 2108 KiB
hand_02.txt AC 354 ms 13148 KiB
hand_03.txt AC 356 ms 13176 KiB
hand_04.txt AC 356 ms 13592 KiB
hand_05.txt AC 359 ms 13660 KiB
random_00.txt AC 348 ms 10796 KiB
random_01.txt AC 345 ms 10836 KiB
random_02.txt AC 347 ms 10688 KiB
random_03.txt AC 350 ms 11872 KiB
random_04.txt AC 351 ms 11940 KiB
random_05.txt AC 351 ms 11972 KiB
random_06.txt AC 346 ms 13688 KiB
random_07.txt AC 355 ms 13600 KiB
random_08.txt AC 353 ms 13484 KiB
random_09.txt AC 356 ms 13624 KiB
random_10.txt AC 353 ms 13600 KiB
random_11.txt AC 354 ms 13704 KiB
random_12.txt AC 350 ms 13260 KiB
random_13.txt AC 352 ms 13356 KiB
random_14.txt AC 355 ms 13568 KiB
random_15.txt AC 350 ms 13580 KiB
random_16.txt AC 357 ms 13612 KiB
random_17.txt AC 361 ms 13444 KiB
random_18.txt AC 357 ms 13532 KiB
random_19.txt AC 352 ms 13624 KiB
random_20.txt AC 353 ms 13636 KiB