Submission #1128610

#TimeUsernameProblemLanguageResultExecution timeMemory
1128610MathiasRoom Temperature (JOI24_ho_t1)C++20
100 / 100
115 ms4540 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back const int INF = 1e9+7; vector<int>v; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,t,x,m,res=INF; cin>>n>>t; for(int i=1;i<=n;i++){ cin>>x; x%=t; v.pb(x); v.pb(x-t); } sort(v.begin(),v.end()); for(int i=n-1;i<v.size();i++){ m=v[i-n+1]; res=min(res,(v[i]-m+1)/2); } cout<<res<<'\n'; return 0; }
#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...