結果
| 問題 | No.1663 Maximum Remainder |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-03 21:55:21 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 359 bytes |
| 記録 | |
| コンパイル時間 | 668 ms |
| コンパイル使用メモリ | 93,808 KB |
| 実行使用メモリ | 7,968 KB |
| 最終ジャッジ日時 | 2026-06-22 23:49:29 |
| 合計ジャッジ時間 | 1,602 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
const int INF=1<<25;
int main()
{
int a,b,c,d,m;
int ans = 0;
cin >> a >> b >> c >> d >> m;
for(int x = a;x<=b;x++)for(int y = c;y<=d;y++) {
ans = max(ans, (x+y)%m);
}
cout << ans << endl;
}