結果

問題 No.3067 +10 Seconds Clock
コンテスト
ユーザー urectanc
提出日時 2025-03-23 17:48:22
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 11 ms / 2,000 ms
+ 900µs
コード長 559 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 786 ms
コンパイル使用メモリ 179,272 KB
実行使用メモリ 9,876 KB
最終ジャッジ日時 2026-10-21 07:15:11
合計ジャッジ時間 4,341 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::{input, marker::Usize1};

fn main() {
    input! {
        n: usize, mut remain: i64,
        t: [i64; n - 1],
        k: usize,
        x: [Usize1; k]
    }

    let mut j = 0;
    let mut n_bonus = 0;
    for (i, &t) in t.iter().enumerate() {
        if remain + n_bonus * 10 <= t {
            println!("-1");
            return;
        }
        remain -= t;

        if j < k && x[j] == i + 1 {
            j += 1;
            n_bonus += 1;
        }
    }

    let ans = ((-remain).max(-1)).div_euclid(10) + 1;
    println!("{}", ans);
}
0