Submission #1011587

#TimeUsernameProblemLanguageResultExecution timeMemory
1011587amunduzbaevRoom Temperature (JOI24_ho_t1)C++17
100 / 100
70 ms7252 KiB
#include "bits/stdc++.h" using namespace std; #define ar array typedef long long ll; //~ #define int ll void solve(){ int n, t; cin >> n >> t; vector<int> a(n); for(int i=0;i<n;i++){ cin >> a[i]; a[i] %= t; } sort(a.begin(), a.end()); int mx = a[0] + t - a[n - 1]; for(int i=1;i<n;i++){ mx = max(mx, a[i] - a[i - 1]); } cout<<(t - mx + 1) / 2<<"\n"; } signed main() { ios::sync_with_stdio(0); cin.tie(0); int t = 1; //~ cin >> t; while(t--){ solve(); } }
#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...