結果
問題 | No.1663 Maximum Remainder |
ユーザー |
![]() |
提出日時 | 2021-09-03 21:22:26 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 77 ms / 2,000 ms |
コード長 | 515 bytes |
コンパイル時間 | 2,466 ms |
コンパイル使用メモリ | 74,532 KB |
実行使用メモリ | 51,204 KB |
最終ジャッジ日時 | 2024-12-15 09:35:33 |
合計ジャッジ時間 | 3,699 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
import java.io.*;import java.util.*;class Main{public static void main(String args[])throws Exception{BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));StringBuilder sb=new StringBuilder();String s[]=bu.readLine().split(" ");int ans=0,i,j,a[]=new int[5];for(i=0;i<5;i++) a[i]=Integer.parseInt(s[i]);for(i=a[0];i<=a[1];i++)for(j=a[2];j<=a[3];j++) ans=Math.max(ans,(i+j)%a[4]);System.out.print(ans);}}