Submission #704304

#TimeUsernameProblemLanguageResultExecution timeMemory
704304chenyanLutrija (COCI19_lutrija)C++17
14 / 70
1 ms320 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define ff first #define ss second #define all(x) x.begin(),x.end() #define pb emplace_back #define N 200010 bool isp(int x){ if(x==1)return 0; for(int i=2;i*i<=x;i++) if(x%i==0)return 0; return 1; } signed main(){ ios::sync_with_stdio(0); cin.tie(0); int a,b,i,j; cin>>a>>b; if(max(a,b)==7&&min(a,b)==3){ cout<<"3\n"<<a<<' '<<5<<' '<<b<<'\n'; } else if(isp(abs(a-b))){ if(isp(abs(a-b))){ cout<<2<<'\n'<<a<<' '<<b<<'\n'; } else cout<<-1<<'\n'; } else if(a==2||b==2){ if(isp(max(a,b)+2)){ cout<<3<<'\n'<<a<<' '<<max(a,b)+2<<' '<<b<<'\n'; } else if(isp(max(a,b)-2)&&isp(max(a,b)-4)){ cout<<3<<'\n'<<a<<' '<<max(a,b)-2<<' '<<b<<'\n'; } else cout<<-1<<'\n'; } else{ if(isp(a-2)&&isp(b-2))cout<<3<<'\n'<<a<<' '<<2<<' '<<b<<'\n'; else cout<<"-1\n"; } }

Compilation message (stderr)

lutrija.cpp: In function 'int main()':
lutrija.cpp:19:10: warning: unused variable 'i' [-Wunused-variable]
   19 |  int a,b,i,j;
      |          ^
lutrija.cpp:19:12: warning: unused variable 'j' [-Wunused-variable]
   19 |  int a,b,i,j;
      |            ^
#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...