結果
| 問題 | No.1663 Maximum Remainder |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-11 12:42:06 |
| 言語 | Rust (1.92.0 + proconio + num) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 398 bytes |
| 記録 | |
| コンパイル時間 | 26,447 ms |
| コンパイル使用メモリ | 411,652 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-11 12:42:34 |
| 合計ジャッジ時間 | 25,289 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
use proconio::{fastout, input};
#[fastout]
fn main() {
input! {
a: u16,
b: u16,
c: u16,
d: u16,
m: u16,
}
println!("{}", output(solve(a, b, c, d, m)));
}
fn solve(a: u16, b: u16, c: u16, d: u16, m: u16) -> u16 {
if (a + c) / m != (b + d) / m {
m - 1
} else {
(b + d) % m
}
}
fn output(ans: u16) -> u16 {
ans
}