21882022-12-30 13:28:561478Oszthatóság 31-gyelcpp11Elfogadva 50/503ms4148 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())

int main()
{
    // ifstream cin("be.txt");
    int n;
    cin >> n;

    vector<int> answers;
    n = n / 10 - 3 * (n % 10);
    while (n > 0)
    {
        answers.push_back(n);
        n = n / 10 - 3 * (n % 10);
    }

    if (n % 31 == 0)
    {
        if (n == 0)
        {
            answers.push_back(n);
        }
        cout << "IGEN" << endl;
    }
    else
    {
        cout << "NEM" << endl;
    }

    for (int i = 0; i < answers.size(); i++)
    {
        cout << answers[i] << " ";
    }
    
    cout << endl;

    return 0;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base50/50
1Elfogadva0/03ms1684 KiB
2Elfogadva0/02ms1848 KiB
3Elfogadva3/32ms2200 KiB
4Elfogadva3/32ms2264 KiB
5Elfogadva4/42ms2464 KiB
6Elfogadva4/42ms2672 KiB
7Elfogadva4/42ms2880 KiB
8Elfogadva4/42ms2956 KiB
9Elfogadva4/42ms3080 KiB
10Elfogadva4/42ms3152 KiB
11Elfogadva4/42ms3404 KiB
12Elfogadva4/42ms3652 KiB
13Elfogadva4/42ms3768 KiB
14Elfogadva4/42ms3904 KiB
15Elfogadva2/22ms3936 KiB
16Elfogadva2/22ms4148 KiB