結果
問題 | No.1663 Maximum Remainder |
ユーザー |
|
提出日時 | 2021-09-03 21:24:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 1,639 ms |
コンパイル使用メモリ | 165,372 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-15 09:40:25 |
合計ジャッジ時間 | 2,338 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> const int maxn = 1005; int a[maxn], dp[maxn]; int main() { int a, b, c, d, m; scanf("%d %d %d %d %d", &a, &b, &c, &d, &m); int res = -1; for (int i = a; i <= b; i ++) { for (int j = c; j <= d; j ++) { res = std::max(res, (i + j) % m); } } std::cout << res << "\n"; return 0; }