# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
251318 | 2020-07-20T19:27:14 Z | Bruteforceman | Lutrija (COCI19_lutrija) | C++11 | 1046 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; bool isPrime(long long x) { if(x <= 1) return false; for(int i = 2; 1LL * i * i <= x; i++) { if(x % i == 0) { return false; } } return true; } void good(vector <long long> v) { for(auto i : v) if(!isPrime(i)) return ; for(int i = 1; i < v.size(); i++) if(!isPrime(abs(v[i] - v[i - 1]))) { return ; } cout << v.size() << endl; for(auto i : v) { cout << i << " "; } cout << endl; exit(0); } int main() { long long A, B; cin >> A >> B; vector <long long> v ({A, B}); good(v); for(auto i : {2LL, A + 2, A - 2, B + 2, B - 2}) { auto u = v; u.insert(u.begin() + 1, i); good(u); } cout << -1 << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 0 ms | 256 KB | Output is correct |
4 | Correct | 0 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 933 ms | 360 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 926 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1046 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 819 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |