Submission #15557885


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        n: i64,
        m: usize,
        a: i64,
        b: i64,
        c: [i64; m]
    };

    let mut now = n;
    for (i, &c_i) in c.iter().enumerate() {
        if now <= a {
            now += b;
        }
        if now < c_i {
            println!("{}", i + 1);
            return;
        }
        now -= c_i;
    }
    println!("complete");
}

Submission Info

Submission Time
Task A - 名刺交換
User bouzuya
Language Rust (1.42.0)
Score 100
Code Size 402 Byte
Status
Exec Time 6 ms
Memory 2156 KB

Judge Result

Set Name Score / Max Score Test Cases
All 100 / 100 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 02_amax_00.txt, 02_amax_01.txt, 02_amax_02.txt, 02_amax_03.txt, 02_amax_04.txt, 02_amax_05.txt, 02_amax_06.txt, 02_amax_07.txt, 02_amax_08.txt, 02_amax_09.txt, 03_2max_00.txt, 03_2max_01.txt, 03_2max_02.txt, 03_2max_03.txt, 03_2max_04.txt, 03_2max_05.txt, 03_2max_06.txt, 03_2max_07.txt, 03_2max_08.txt, 03_2max_09.txt, 04_3max_00.txt, 04_3max_01.txt, 04_3max_02.txt, 04_3max_03.txt, 04_3max_04.txt, 04_3max_05.txt, 04_3max_06.txt, 04_3max_07.txt, 04_3max_08.txt, 04_3max_09.txt
Case Name Status Exec Time Memory
00_sample_01.txt 6 ms 2052 KB
00_sample_02.txt 2 ms 1992 KB
00_sample_03.txt 1 ms 2040 KB
00_sample_04.txt 2 ms 2024 KB
00_sample_05.txt 1 ms 1992 KB
01_rand_00.txt 1 ms 2024 KB
01_rand_01.txt 2 ms 1912 KB
01_rand_02.txt 1 ms 2012 KB
01_rand_03.txt 1 ms 1944 KB
01_rand_04.txt 2 ms 2016 KB
01_rand_05.txt 1 ms 2020 KB
01_rand_06.txt 2 ms 2004 KB
01_rand_07.txt 3 ms 1996 KB
01_rand_08.txt 1 ms 2012 KB
01_rand_09.txt 2 ms 2156 KB
01_rand_10.txt 6 ms 2076 KB
01_rand_11.txt 6 ms 2012 KB
01_rand_12.txt 2 ms 2044 KB
01_rand_13.txt 2 ms 2000 KB
01_rand_14.txt 2 ms 2084 KB
01_rand_15.txt 2 ms 2016 KB
01_rand_16.txt 1 ms 1976 KB
01_rand_17.txt 2 ms 1980 KB
01_rand_18.txt 1 ms 1988 KB
01_rand_19.txt 2 ms 2020 KB
02_amax_00.txt 1 ms 2100 KB
02_amax_01.txt 1 ms 2016 KB
02_amax_02.txt 1 ms 1980 KB
02_amax_03.txt 2 ms 2040 KB
02_amax_04.txt 1 ms 2052 KB
02_amax_05.txt 2 ms 2016 KB
02_amax_06.txt 1 ms 2048 KB
02_amax_07.txt 2 ms 2092 KB
02_amax_08.txt 2 ms 1996 KB
02_amax_09.txt 1 ms 2032 KB
03_2max_00.txt 1 ms 2032 KB
03_2max_01.txt 2 ms 2020 KB
03_2max_02.txt 2 ms 2084 KB
03_2max_03.txt 2 ms 2072 KB
03_2max_04.txt 2 ms 2048 KB
03_2max_05.txt 2 ms 2028 KB
03_2max_06.txt 1 ms 2016 KB
03_2max_07.txt 1 ms 1948 KB
03_2max_08.txt 1 ms 1996 KB
03_2max_09.txt 2 ms 2076 KB
04_3max_00.txt 2 ms 1944 KB
04_3max_01.txt 1 ms 2012 KB
04_3max_02.txt 1 ms 1980 KB
04_3max_03.txt 1 ms 2020 KB
04_3max_04.txt 1 ms 2064 KB
04_3max_05.txt 5 ms 2072 KB
04_3max_06.txt 2 ms 2112 KB
04_3max_07.txt 1 ms 2084 KB
04_3max_08.txt 2 ms 2152 KB
04_3max_09.txt 2 ms 2080 KB