# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
725445 | 2023-04-17T12:49:31 Z | kerem | Lutrija (COCI19_lutrija) | C++14 | 157 ms | 276 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define fir first #define sec second #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); bool asalMi(int x){ if(x==1) return false; bool c=true; for(int i=2;i<sqrt(x);i++){ if(x%i==0){ c=false; break; } } return c; } int32_t main(){ int x,y; cin >> x >> y; if(asalMi(abs(x-y))){ cout << 2 << endl; cout << x << " " << y; return 0; } if(x==2 and y==2){ cout << 3 << endl; cout << "2 5 2"; return 0; } vector<int> v; if(x==2) v.pb(2); else{ if(asalMi(x-2)) v.pb(x),v.pb(2); else if(asalMi(x+2)) v.pb(x),v.pb(x+2),v.pb(2); else{ cout << -1; return 0; } } if(y!=2){ if(asalMi(y-2)) v.pb(y); else if(asalMi(y+2)) v.pb(y+2),v.pb(y); else{ cout << -1; return 0; } } cout << v.size() << endl; for(int i=0;i<v.size();i++) cout << v[i] << " "; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 140 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 141 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 157 ms | 276 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 110 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |