# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
816284 | QwertyPi | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 1029 ms | 114836 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e7 + 11;
const int MAXM = 1e5 + 11;
int p[MAXM];
int lp[MAXN], dp[MAXN], c[MAXN], c2[MAXN], cm = 0;
void del(int p){
c2[c[p]]--;
while(cm < MAXN - 1 && c2[cm] == 0) cm++;
}
int32_t main(){
cin.tie(0); cout.tie(0)->sync_with_stdio(false);
int n, Q; cin >> n >> Q;
for(int i = 0; i < n; i++) cin >> p[i]; sort(p, p + n);
for(int i = 0; i < n; i++){
for(int j = p[i]; j < MAXN; j += p[i]){
if(!lp[j]) lp[j] = p[i];
}
}
dp[1] = 0; c2[0] = n; cm = 0;
for(int i = 2; i < MAXN; i++){
int x = i;
while(lp[x] != 0){
if(lp[x] != lp[x / lp[x]]){
del(lp[x]);
}
컴파일 시 표준 에러 (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... |