結果
| 問題 | No.561 東京と京都 |
| コンテスト | |
| ユーザー |
cra77756176
|
| 提出日時 | 2022-12-07 00:13:44 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 2,000 ms |
| + 814µs | |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 587 ms |
| コンパイル使用メモリ | 176,972 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-15 15:57:46 |
| 合計ジャッジ時間 | 2,305 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 17 |
ソースコード
fn main() {
let mut input = String::new();
std::io::Read::read_to_string(&mut std::io::stdin(), &mut input).ok();
let input: Vec<i64> = input
.split_whitespace()
.map(|n| n.parse().unwrap())
.collect();
let d = input[1];
let mut income = (0, -d);
for tk in input[2..].chunks(2) {
income = (
income.0.max(income.1 - d) + tk[0],
income.1.max(income.0 - d) + tk[1],
);
}
println!("{}", income.0.max(income.1));
}
cra77756176