結果
問題 |
No.1663 Maximum Remainder
|
ユーザー |
![]() |
提出日時 | 2021-10-21 15:42:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 291 bytes |
コンパイル時間 | 565 ms |
コンパイル使用メモリ | 65,032 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 11:14:36 |
合計ジャッジ時間 | 1,458 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <iostream> using namespace std; int main() { int a, b, c, d, m; cin >> a >> b >> c >> d >> m; int res = 0; for (int x = a; x < b + 1; x++) { for (int y = c; y < d + 1; y++) { int tmp = (x + y) % m; if (tmp > res) res = tmp; } } cout << res << endl; return 0; }