# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
631372 | CDuong | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 326 ms | 79104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define pii pair<int, int>
using namespace std;
const int mxN = 1e7 + 5;
const int mod = 1e9 + 7;
int m, Q, dp[mxN];
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("Bai3.inp", "r", stdin);
//freopen("Bai3.out", "w", stdout);
cin >> m >> Q;
for(int i = 1; i <= m; ++i){
int p; cin >> p;
for(int j = p - 1; j < mxN; j += p){
dp[j] = max(dp[j], p - 1);
}
}
for(int i = mxN - 2; i >= 0; --i){
dp[i] = max(dp[i], dp[i + 1] - 1);
}
dp[0] = 0;
for(int i = 1; i < mxN; ++i){
if(dp[i] > 0){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |