# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596525 | 2022-07-14T19:53:43 Z | Hussein3600 | Lutrija (COCI19_lutrija) | C++14 | 8 ms | 1572 KB |
#include<bits/stdc++.h> using namespace std ; typedef long long ll ; const int N=1e6 ; vector<bool>vis(N+9) ; vector<ll>p ; vector<pair<ll,ll> >dif; ll last=2; int main() { for(int i=2;i<=N;i++) { if(!vis[i]) { for(int j=i;j<=N;j+=i) { vis[j]=true; } p.push_back(i) ; } } //cout<<p.size()<<endl; ll a , b ; cin >> a >> b ; if(abs(a-b)==2)cout<<a<<" "<<b<<endl; else{ bool ok=true; for(int i=0;i<p.size();i++) { if((a+b)%p[i]==0&&p[i]!=a+b)ok=false ; } if(ok)cout<<a<<" "<<a+b<<" "<<b<<endl; else cout<<-1<<endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1572 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 8 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1484 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 1504 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |