結果

問題 No.842 初詣
ユーザー phspls
提出日時 2020-02-12 22:53:34
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 838 bytes
コンパイル時間 13,809 ms
コンパイル使用メモリ 401,288 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 04:57:10
合計ジャッジ時間 13,783 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::Read;

fn main() {
    let mut all_data = String::new();
    std::io::stdin().read_to_string(&mut all_data).ok();
    let abcdefg: Vec<usize> = all_data.trim().split('\n').next().unwrap().split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect();
    for a in 0..=abcdefg[0] {
        for b in 0..=abcdefg[1] {
            for c in 0..=abcdefg[2] {
                for d in 0..=abcdefg[3] {
                    for e in 0..=abcdefg[4] {
                        for f in 0..=abcdefg[5] {
                            if 500*a + 100*b + 50*c + 10*d + 5*e + f == abcdefg[6] {
                                println!("YES");
                                return;
                            }
                        }
                    }
                }
            }
        }
    }
    println!("NO");
}
0