# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596525 | Hussein3600 | Lutrija (COCI19_lutrija) | C++14 | 8 ms | 1572 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 ;
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 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |