Submission #15462727


Source Code Expand

Copy
use proconio::input;

fn main() {
    input! {
        n: usize,
        a: [i64; n],
    };
    let mut s = 0;
    let mut m = 1_000_i64;
    for i in 0..n {
        m += a[i] * s;
        s = 0;
        if i + 1 < n {
            if a[i] < a[i + 1] {
                s = m / a[i];
                m -= s * a[i];
            }
        }
    }
    let ans = m;
    println!("{}", ans);
}

Submission Info

Submission Time
Task D - Road to Millionaire
User bouzuya
Language Rust (1.42.0)
Score 400
Code Size 388 Byte
Status
Exec Time 9 ms
Memory 2172 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0
All 400 / 400 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-random-01.txt, 01-random-02.txt, 01-random-03.txt, 01-random-04.txt, 01-random-05.txt, 01-random-06.txt, 01-random-07.txt, 01-random-08.txt, 01-random-09.txt, 01-random-10.txt, 02-increasing-01.txt, 03-decreasing-01.txt, 04-large-01.txt, 04-large-02.txt, 04-large-03.txt, 05-maximum-01.txt, 05-maximum-02.txt, 05-maximum-03.txt
Case Name Status Exec Time Memory
00-sample-01.txt 9 ms 1960 KB
00-sample-02.txt 1 ms 1948 KB
00-sample-03.txt 1 ms 1900 KB
01-random-01.txt 1 ms 2112 KB
01-random-02.txt 2 ms 2076 KB
01-random-03.txt 2 ms 2172 KB
01-random-04.txt 2 ms 2060 KB
01-random-05.txt 1 ms 2080 KB
01-random-06.txt 1 ms 2104 KB
01-random-07.txt 1 ms 2164 KB
01-random-08.txt 2 ms 2120 KB
01-random-09.txt 1 ms 2016 KB
01-random-10.txt 1 ms 2068 KB
02-increasing-01.txt 1 ms 1964 KB
03-decreasing-01.txt 1 ms 2084 KB
04-large-01.txt 1 ms 2084 KB
04-large-02.txt 2 ms 1996 KB
04-large-03.txt 2 ms 2076 KB
05-maximum-01.txt 1 ms 1968 KB
05-maximum-02.txt 1 ms 1996 KB
05-maximum-03.txt 1 ms 2000 KB