| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1200411 | algoproclub | Room Temperature (JOI24_ho_t1) | C++20 | 158 ms | 4168 KiB |
// UUID: c820fd8a-4163-4088-bd1d-48a8fab65fbd
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, t;
cin >> n >> t;
vector<int> a(n);
for(int i = 0; i < n; i++){
cin >> a[i];
a[i] %= t;
}
sort(a.begin(), a.end());
a.push_back(a[0] + t);
int ans = INT_MAX;
for(int i = 1; i <= n; i++){
ans = min(ans, (a[i - 1] + t - a[i]) / 2 + (a[i - 1] + t - a[i]) % 2);
}
cout << ans;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
