제출 #1127449

#제출 시각아이디문제언어결과실행 시간메모리
1127449ttamxRoom Temperature (JOI24_ho_t1)C++20
100 / 100
88 ms2376 KiB
#include<bits/stdc++.h> using namespace std; const int N=5e5+5; int n,t; int a[N],mx; int ans=INT_MAX; int main(){ cin.tie(nullptr)->sync_with_stdio(false); cin >> n >> t; for(int i=1;i<=n;i++){ cin >> a[i]; a[i]%=t; } sort(a+1,a+n+1); mx=a[n]; for(int i=1;i<=n;i++){ ans=min(ans,mx-a[i]); mx=a[i]+t; } cout << (ans+1)/2; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...