| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1240214 | rythm_of_knight | Room Temperature (JOI24_ho_t1) | C++17 | 64 ms | 4168 KiB |
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define ar array
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
ll n, t;
cin >> n >> t;
vector <ll> a(n + 1, 0);
for (int i = 1; i <= n; i++)
cin >> a[i], a[i] %= t;
sort(all(a));
ll k = t / 2, res = 0, ans = 0;
for (int i = 1; i <= n; i++) {
int j = i - 1;
if (j == 0)
j = n;
ans = max(ans, (a[i] - a[j] + t) % t);
}
ans = (t - ans) % t;
cout << (ans + 1) / 2 << '\n';
}| # | 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... | ||||
