結果
| 問題 |
No.3041 非対称じゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-07 20:10:44 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 941 bytes |
| コンパイル時間 | 13,635 ms |
| コンパイル使用メモリ | 401,516 KB |
| 実行使用メモリ | 13,640 KB |
| 最終ジャッジ日時 | 2025-01-07 20:11:39 |
| 合計ジャッジ時間 | 32,471 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 TLE * 5 |
ソースコード
use proconio::input;
fn main() {
input! {
n: usize,
_f: usize,
abc: [[usize; n]; 3],
}
let abc = (0..n)
.map(|i| [abc[0][i], abc[1][i], abc[2][i]])
.collect::<Vec<_>>();
let m = abc.iter().map(|x| x.iter().max().unwrap()).sum::<usize>();
let mut dp = vec![false; m + 1];
dp[0] = true;
let ans = abc
.iter()
.map(|x| {
let mut swp = vec![false; m + 1];
for &x in x {
for (swp, dp) in swp[x..].iter_mut().zip(dp.iter()) {
if *dp {
*swp = true;
}
}
}
dp = swp;
dp.iter().filter(|dp| **dp).count()
})
.collect::<Vec<_>>();
println!(
"{}",
ans.iter()
.map(std::string::ToString::to_string)
.collect::<Vec<_>>()
.join("\n")
);
}