Submission #244258

# Submission time Handle Problem Language Result Execution time Memory
244258 2020-07-03T12:01:58 Z Halit Lutrija (COCI19_lutrija) C++17
0 / 70
5 ms 384 KB
#include <bits/stdc++.h>
using namespace std;

bool isPrime(long long n){
	if(n == 2) return true;
	if(n % 2 == 0) return false;
	if(n < 2) return false;
	
	for(int i = 3;i * i <= n;i+=2)
		if(n % i == 0) 
			return false;
	return true;
}
int main(){
	long long a,b;
	cin >> a >> b;
	
	if(isPrime(abs(a-b) ) )
		cout << 2 << "\n" << a << " " << b;

	else if(a == 2 && b == 2)
		cout << "3 \n2 7 2";
	
	else if(a == 2 && isPrime(b+2) )
		cout << "3 \n2 " << b+2 << " " << b;
		
	else if(b == 2 && isPrime(a+2) )
		cout << "3 \n " <<   a << " " << a+2 << " " << b;	
	else
		cout << -1;
}


# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Incorrect 5 ms 384 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -