結果
| 問題 | No.1663 Maximum Remainder |
| コンテスト | |
| ユーザー |
srjywrdnprkt
|
| 提出日時 | 2023-06-07 01:53:09 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 474 bytes |
| 記録 | |
| コンパイル時間 | 946 ms |
| コンパイル使用メモリ | 104,408 KB |
| 最終ジャッジ日時 | 2025-02-13 23:09:58 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>
using namespace std;
using ll = long long;
int main(){
int a, b, c, d, m, ans=0;
cin >> a >> b >> c >> d >> m;
for (int i=a; i<=b; i++){
for (int j=c; j<=d; j++) ans = max(ans, (i+j)%m);
}
cout << ans << endl;
return 0;
}
srjywrdnprkt