結果
| 問題 | No.1663 Maximum Remainder |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-08 09:28:10 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 1,112 bytes |
| 記録 | |
| コンパイル時間 | 12,180 ms |
| コンパイル使用メモリ | 388,712 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 08:38:07 |
| 合計ジャッジ時間 | 13,209 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#[allow(dead_code)]
pub mod ut {
#[macro_export]
macro_rules! input {
( string ) => {{
let mut buf = String::new();
std::io::stdin()
.read_line(&mut buf)
.map(|_| buf.trim().to_string())
.unwrap()
}};
( [ $t:ty ] ) => {{
input!(string)
.split_ascii_whitespace()
.map(|x| x.parse::<$t>().unwrap())
.collect::<Vec<_>>()
}};
( ( $($t:ty ),* ) ) => {{
let buf = input!(string);
let mut it = buf.split_ascii_whitespace();
( $( it.next().map(|x| x.parse::<$t>().unwrap() ).unwrap(), )* )
}};
( $($x:tt),* ) => {{
{ ( $( input!($x) ),* ) }
}};
}
}
fn main() {
let (a, b, c, d, m) = input! {(usize, usize, usize, usize, usize)};
let ans = {
let mut ans = 0usize;
for ix in a..=b {
for iy in c..=d {
ans = std::cmp::max(ans, (ix + iy) % m);
}
}
ans
};
println!("{}", ans);
}