Submission #391235

#TimeUsernameProblemLanguageResultExecution timeMemory
391235sadLutrija (COCI19_lutrija)C++14
0 / 70
1 ms300 KiB
#include <bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back using namespace std; int go (int x) { for(int i=2;i*i<=x;i++) { if((x%i)==0)return 0; } return 1; } int main() { ll l,r;cin>>l>>r; if(go(abs(r-l))) { cout<<2<<endl<<l<<" "<<r;return 0; } if(r-2>1&&go(abs(r-2-l))) { cout<<3<<endl<<l<<" "<<r-2<<" "<<r;return 0; } if(l-2>1&&go(abs(l-2-r))) { cout<<3<<endl<<l<<" "<<l-2<<" "<<r;return 0; } if(go(abs(r+2-l))) { cout<<3<<endl<<l<<" "<<r+2<<" "<<r;return 0; } if(go(abs(l+2-r))) { cout<<3<<endl<<l<<" "<<l+2<<" "<<r;return 0; } cout<<-1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...