# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
757336 | The_Samurai | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 381 ms | 80204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
bool isPrime(int n) {
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;
}
}
return n > 1;
}
int INF = 1e9;
int main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
clock_t startTime = clock();
int n, q, N = 1e7;
cin >> n >> q;
vector<int> primes(n), g(N + 1), dp(N + 1, INF);
iota(g.begin(), g.end(), 0);
for (int &p: primes) {
cin >> p;
}
sort(primes.rbegin(), primes.rend());
for (int i = 0; i < n; i++) {
int p = primes[i], nextp;
if (i + 1 < n) {
nextp = primes[i + 1];
Compilation message (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... |