21712022-12-28 15:59:481478Oszthatóság 31-gyelcpp11Wrong answer 25/503ms4144 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int>> vv32;
typedef vector<vector<ll>> vv64;
typedef vector<vector<p64>> vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
double eps = 1e-12;
#define forn(i, e) for (ll i = 0; i < e; i++)
#define forsn(i, s, e) for (ll i = s; i < e; i++)
#define rforn(i, s) for (ll i = s; i >= 0; i--)
#define rforsn(i, s, e) for (ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout << #x << " = " << x << ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

void breaker(int n)
{
    n = n / 10 - 3 * (n % 10);
    while (n > 0 && n % 31 == 0)
    {
        cout << n << " ";
        n = n / 10 - 3 * (n % 10);
    }
}

int main()
{
    //ifstream cin("be.txt");
    int n;
    cin >> n;
    if (n % 31 == 0)
    {
        cout << "IGEN" << ln;
        breaker(n);
        cout << 0;
    }
    else
    {
        cout << "NEM" << ln;
        breaker(n);
    }

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base25/50
1Accepted0/03ms1872 KiB
2Wrong answer0/02ms2064 KiB
3Wrong answer0/32ms2216 KiB
4Accepted3/32ms2392 KiB
5Accepted4/42ms2636 KiB
6Wrong answer0/42ms2664 KiB
7Wrong answer0/42ms2796 KiB
8Accepted4/42ms2856 KiB
9Accepted4/42ms2984 KiB
10Wrong answer0/42ms3188 KiB
11Accepted4/42ms3392 KiB
12Wrong answer0/42ms3600 KiB
13Wrong answer0/42ms3832 KiB
14Accepted4/42ms3820 KiB
15Accepted2/22ms3944 KiB
16Wrong answer0/22ms4144 KiB