結果
問題 | No.1663 Maximum Remainder |
ユーザー |
![]() |
提出日時 | 2021-09-03 21:20:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 822 bytes |
コンパイル時間 | 199 ms |
コンパイル使用メモリ | 82,848 KB |
実行使用メモリ | 63,280 KB |
最終ジャッジ日時 | 2024-12-15 09:27:40 |
合計ジャッジ時間 | 1,345 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
import sys import math from collections import deque,Counter from sys import stdin #sys.setrecursionlimit(10**7) int1=lambda x: int(x)-1 stinput=lambda :stdin.readline()[:-1] ii=lambda :int(stinput()) mi=lambda :map(int, stdin.readline().split()) li=lambda :list(mi()) mi1=lambda :map(int1, stdin.readline().split()) li1=lambda :list(mi1()) mis=lambda :stdin.readline()[:-1] pr=print rg=range from collections import defaultdict """ #初期値 0 d=defaultdict(int) #初期値 1 d=defaultdict(lambda:1) """ import heapq """ # リストを優先度付きキューへ heapq.heapify(hq) # 最小値の取り出し heapq.heappop(hq) # 要素の挿入 heapq.heappush(hq,1) """ mod=10**9+7 Mod=998244353 INF=10**18 ans=0 a,b,c,d,m=mi() for i in range(a,b+1): for j in range(c,d+1): ans=max(ans,(i+j)%m) print(ans)