| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357020 | kismis | Room Temperature (JOI24_ho_t1) | C++20 | 128 ms | 4324 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vt vector
#define pb push_back
#define pob pop_back
#define endl '\n'
#define fi first
#define se second
signed main(){
int n , k;
cin >> n >> k;
vt<int> a(n);
for(int& i : a)
cin >> i;
for(int i=0; i<n ; i++)
a[i] = a[i]%k;
sort(a.begin() , a.end());
int ans = a[n-1] - a[0];
for(int i=n-2 ; i>=0 ; i--){
ans = min(ans , abs(a[i] - (a[i+1]-k)));
}
cout << (ans+1)/2 << endl;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
