| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1308022 | nanaseyuzuki | Room Temperature (JOI24_ho_t1) | C++20 | 105 ms | 4648 KiB |
#include <bits/stdc++.h>
// Kazusa_Megumi
#define ll long long
#define fi first
#define se second
#define pii pair<int, int>
#define all(a) a.begin(), a.end()
using namespace std;
const int mn = 5e5 + 5, mod = 1e9 + 7, inf = 2e9;
void solve() {
int n, k; cin >> n >> k;
vector <int> val;
for(int i = 1; i <= n; i++){
int x; cin >> x;
val.push_back(x % k); val.push_back(x % k + k);
}
sort(all(val));
int mx = 0;
for(int i = 0; i < 2 * n - 1; i++) mx = max(mx, val[i + 1] - val[i]);
cout << (k - mx + 1) / 2 << '\n';
}
main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
if (fopen("Kazuki.INP", "r")) {
freopen("Kazuki.INP", "r", stdin);
freopen("Kazuki.OUT", "w", stdout);
}
int t = 1;
// cin >> t;
while (t--) solve();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
