結果
| 問題 |
No.1663 Maximum Remainder
|
| コンテスト | |
| ユーザー |
monnu
|
| 提出日時 | 2021-09-03 21:52:33 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 398 bytes |
| コンパイル時間 | 4,293 ms |
| コンパイル使用メモリ | 229,848 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-15 12:44:12 |
| 合計ジャッジ時間 | 4,494 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll=long long;
using Graph=vector<vector<pair<int,int>>>;
#define MAX 100000
#define MOD 1000000007
#define INF 1000000000
int main(){
int a,b,c,d,m;
cin>>a>>b>>c>>d>>m;
int ans=0;
for(int x=a;x<=b;x++){
for(int y=c;y<=d;y++){
ans=max(ans,(x+y)%m);
}
}
cout<<ans<<'\n';
}
monnu