# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
87770 | JustInCase | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 38 ms | 39268 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
const int32_t MAX_N = 1e7;
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;
int32_t maxP;
for(int32_t i = 0; i < m; i++) {
int32_t p;
std::cin >> p;
maxP = std::max(maxP, p);
if(lcm <= MAX_N) {
lcm *= (int64_t) p;
}
}
for(int32_t i = 0; i < q; i++) {
int32_t n;
std::cin >> n;
if(n >= lcm) {
std::cout << "oo" << '\n';
}
else {
if(n % maxP == 0) {
std::cout << 2 * (n / maxP) << '\n';
}
else {
std::cout << 2 * (n / maxP) + 1 << '\n';
}
}
}
}
컴파일 시 표준 에러 (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... |