# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
87783 | JustInCase | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 553 ms | 44272 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
const int32_t MAX_N = 1e7 + 1e6;
int32_t dp[MAX_N + 5];
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
int32_t m, q;
std::cin >> m >> q;
int64_t lcm = 1;
for(int32_t i = 0; i < m; i++) {
int32_t p;
std::cin >> p;
for(int32_t j = p - 1; j <= MAX_N; j += p) {
dp[j] = p - 1;
}
if(lcm < MAX_N) {
lcm *= (int64_t) p;
}
}
for(int32_t i = MAX_N - 1; i >= 1; i--) {
dp[i] = std::max(dp[i], dp[i + 1] - 1);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |