Submission #338962

# Submission time Handle Problem Language Result Execution time Memory
338962 2020-12-24T10:31:37 Z A_D Lutrija (COCI19_lutrija) C++14
0 / 70
1 ms 364 KB
#include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
using namespace std;
bool ok(ll v)
{
    for(ll i=2;i*i<=v;i++){
        if(v%i==0)return 0;
    }
    return 1;
}
main()
{
    ll a,b;
    cin>>a>>b;
    ll k=a+b;
    if(ok(k)){
        cout<<3<<endl;
        cout<<a<<" "<<a+b<<" "<<b<<endl;
        return 0;
    }
    k=a-b;
    if(k<0)k*=-1;
    if(ok(k)){
        cout<<2<<endl;
        cout<<a<<" "<<b<<endl;
        return 0;
    }
    cout<<-1;
}

Compilation message

lutrija.cpp:13:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main()
      |      ^
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -