| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1352673 | spetr | Room Temperature (JOI24_ho_t1) | C++20 | 57 ms | 8192 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mmod = 998244353;
#define vl vector<long long>
#define vll vector<vector<long long>>
#define pl pair<long long, long long>
#define vb vector<bool>
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n,t;
cin >> n >> t;
vl nums (n);
for (ll i = 0; i < n; i++){
ll x;
cin >> x;
nums[i] = x % t;
}
sort(nums.begin(), nums.end());
nums.push_back(nums[0] + t);
ll opt = 1e15;
for (ll i = 0; i < n; i++){
opt = min(opt, (t - nums[i+1] + nums[i]+1)/2);
}
cout << opt <<"\n";
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
