Submission #849826

# Submission time Handle Problem Language Result Execution time Memory
849826 2023-09-15T12:15:19 Z tiwerlol Lutrija (COCI19_lutrija) C++17
0 / 70
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

ofstream fout("xor.out");
ifstream fin("xor.in");

#define miauDebug
#ifdef miauDebug
#define mau(x) MIAUMIAU(#x, x)
#else
#define mau(x)
#endif

void MIAUMIAU(const char* var_name, auto var_value) {
    cout << var_name << " = " << var_value << endl;
}

using ll = long long;
const int nM = 2e5+5;
const ll MOD = 1e9 + 7;
// :3

bool prim(ll a)
{
    if(a==2 || a==3)
        return 1;

    if(a%2==0 || a%3==0)
        return 0;

    for(ll z = 0; z*z <= a; z+=6)
    {
        if((a%(z-1)==0) || (a%(z+1)==0))
            return 1;
    }
    return 0;
}

void solve() {
    ll a, b; cin >> a >> b;

    if(prim(abs(a-b)))
    {
        cout << 2 << '\n';

        cout << a << ' ' << b << '\n';
        return;
    }

    vector<int> ans; bool sw = 0;

    if(a>b)
        b=a, sw = 1;

    if(a!=2)
    {
        cout << "-1\n";
        return;
    }

    if(prim(b+2))
    {
        cout << 3 << '\n';
        cout << 2 << ' ' << b+2 << ' ' << b;
    }
}
signed main()
{
    cout.tie(NULL);
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);

    int tt = 1; //cin >> tt;

    while(tt--)
        solve();
}

Compilation message

lutrija.cpp:14:37: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   14 | void MIAUMIAU(const char* var_name, auto var_value) {
      |                                     ^~~~
lutrija.cpp: In function 'void solve()':
lutrija.cpp:50:27: warning: variable 'sw' set but not used [-Wunused-but-set-variable]
   50 |     vector<int> ans; bool sw = 0;
      |                           ^~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -