# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
447944 | prvocislo | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 888 ms | 123724 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn = 1e7 + 5, inf = 1e9 + 5;
void chmin(int &a, const int &b) { a = min(a, b); }
void chmax(int &a, const int &b) { a = max(a, b); }
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
vector<int> lp(maxn, -1), pr;
for (int i = 2; i < maxn; i++)
{
if (lp[i] == -1) pr.push_back(i), lp[i] = i;
for (int j = 0; j < pr.size() && pr[j] <= lp[i] && i * pr[j] < maxn; j++)
lp[i*pr[j]] = pr[j];
}
int m, q;
cin >> m >> q;
vector<int> p(m);
vector<bool> b(maxn, false);
int mul = 1;
for (int i = 0; i < m; i++)
{
cin >> p[i];
if (mul * 1ll * p[i] < (ll)maxn) mul *= p[i];
else mul = maxn;
b[p[i]] = true;
}
컴파일 시 표준 에러 (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... |