結果

問題 No.1663 Maximum Remainder
ユーザー kohei2019
提出日時 2022-11-04 13:20:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 12 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 1,903 ms
コンパイル使用メモリ 193,848 KB
最終ジャッジ日時 2025-02-08 17:08:46
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;


int main() {
    ll a,b,c,d,m,ans;
    cin >> a>>b>>c>>d>>m;
    ans = 0;
    for (int i=a;i<=b;i++){
        for(int j=c;j<=d;j++){
            ans = max(ans,(i+j)%m);
        }
    }
    cout << ans << endl;

}
0