結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
bubo
|
| 提出日時 | 2018-03-03 21:02:01 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 660 bytes |
| 記録 | |
| コンパイル時間 | 3,731 ms |
| コンパイル使用メモリ | 190,848 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-25 22:21:11 |
| 合計ジャッジ時間 | 2,613 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 7 |
ソースコード
use std::io::stdin;
pub fn main() {
let line = || {
let mut s = String::new();
let _ = stdin().read_line(&mut s);
s
};
let l: usize = line().trim().parse().unwrap();
line();
let mut ws: Vec<usize> = line().split_whitespace().flat_map(|x| x.parse()).collect();
ws.sort();
let mut sum = 0;
for (i, w) in ws.into_iter().enumerate() {
match sum + w {
x if x == l => {
println!("{}", i + 1);
break;
}
x if x > l => {
println!("{}", i);
break;
}
x => sum = x,
}
}
}
bubo