Submission #1127524

#TimeUsernameProblemLanguageResultExecution timeMemory
112752412345678Room Temperature (JOI24_ho_t1)C++20
100 / 100
123 ms8764 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int nx=5e5+5; ll n, x, t, res=LLONG_MAX; vector<ll> v; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>t; for (int i=1; i<=n; i++) cin>>x, v.push_back(x%t), v.push_back(x%t+t); sort(v.begin(), v.end()); for (int i=0; i<n; i++) res=min(res, (v[i+n-1]-v[i]+1)/2); cout<<res; }
#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...