17472022-12-02 18:07:34levente19Oszthatóság 31-gyelcpp11Accepted 50/503ms3796 KiB
#include <bits/stdc++.h>
#define gyorsan ios::sync_with_stdio(0);cin.tie(0)

using namespace std;

int main()
{
    gyorsan;

    vector<long long> kozb;
    long long n;

    cin >> n;

    while(n > 0) {
        int lastDigit = n % 10;
        n = floor(n/10) - lastDigit*3;
        if(n >= 0) kozb.push_back(n);
        else break;
    }

    if(kozb.size() != 0) {
        if(kozb.back() == 0) {
            cout << "IGEN" << endl;
            for(long long l : kozb) {
                cout << l << " ";
            }
        }

        else if(kozb.back() != 0) {
            cout << "NEM" << endl;
                for(long long l : kozb) {
                    cout << l << " ";
                }
            }

        else {
            cout << "NEM" << endl;
            cout << endl;
        }
    }
    else {
        cout << "NEM" << endl;
        cout << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1828 KiB
2Accepted0/02ms2020 KiB
3Accepted3/32ms2228 KiB
4Accepted3/32ms2424 KiB
5Accepted4/42ms2628 KiB
6Accepted4/42ms2860 KiB
7Accepted4/42ms3060 KiB
8Accepted4/42ms3112 KiB
9Accepted4/42ms3244 KiB
10Accepted4/42ms3320 KiB
11Accepted4/42ms3468 KiB
12Accepted4/42ms3436 KiB
13Accepted4/42ms3552 KiB
14Accepted4/42ms3624 KiB
15Accepted2/22ms3632 KiB
16Accepted2/22ms3796 KiB