제출 #1242063

#제출 시각아이디문제언어결과실행 시간메모리
1242063nasjesRoom Temperature (JOI24_ho_t1)C++20
5 / 100
1 ms328 KiB
#include <iostream> #include <iomanip> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <queue> #include <map> #include <stack> #include <bitset> #include <string> #include <cstring> #include <iterator> #include <random> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef long double ld; const ll dim = 1e6+7; //const ll mod = 1e9 + 7; const ll inf = 1e18 + 77; #define endl "\n" #define fi first #define pb push_back #define se second #define vll vector<ll> ll n; ll x; /*ll check(ll val){ ll tp1 for(int i=1; i<=n; i++){ } }*/ ll a[dim]; int main() { cin>>n>>x; for(int i=1; i<=n; i++){ cin>>a[i]; a[i]=min(a[i]%x, x-1-a[i]%x); } sort(a+1, a+1+n); cout<<a[n]<<endl; 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...