제출 #1057336

#제출 시각아이디문제언어결과실행 시간메모리
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...