Submission #1057336

#TimeUsernameProblemLanguageResultExecution timeMemory
1057336beaconmcRoom Temperature (JOI24_ho_t1)C++14
100 / 100
70 ms14676 KiB
#include <bits/stdc++.h> typedef long long ll; #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(ll i=x; i>y; i--) using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ll n,t; cin >> n >> t; vector<ll> arr(n); FOR(i,0,n) cin >> arr[i], arr[i]%= t; sort(arr.begin(), arr.end()); arr.push_back(arr[0]+t); ll ans = 1000000000000; FOR(i,0,n){ ans = min(ans, (arr[i]+t-arr[i+1]+1)/2); } cout << ans << endl; }
#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...