# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485952 | 2021-11-09T19:55:11 Z | tato | Lutrija (COCI19_lutrija) | C++14 | 0 ms | 204 KB |
#include <bits/stdc++.h> #define ll long long using namespace std; bool check(ll a) { ll x=sqrt(a); for(ll k=2; k<=x; k++) if(a%k==0) return false; return true; } int main() { ll a,b; cin>>a>>b; if(a==2 or b==2) { if(check(a+b)) {cout<<3<<'\n'; cout<<a<<' '<<a+b<<' '<<b; return 0; } } if(abs(a-b)==2) { cout<<2<<'\n'; cout<<a<<' '<<b; return 0; } if(a==b) { if(check(a+2)) { cout<<3<<'\n'; cout<<a<<' '<<a+2<<' '<<b; return 0; } } if(abs(a-b)>65 or abs(a-b)==1) { cout<<-1; return 0; } vector <ll> v; for(ll i=min(a,b); i<=b; i+=2) { if(check(i)) { cout<<-1; return 0; } else v.push_back(i); } cout<<v.size()<<'\n'; for(int k=1; k<v.size(); k++) cout<<v[k]<<' '; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |