17512022-12-02 19:11:21levente19Oszthatóság 17-tel (60 pont)cpp11Wrong answer 58/603ms3508 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*5;
        if(n >= 0) kozb.push_back(n);
        else break;
    }

    if(kozb.size() != 0) {
        if(kozb.back() == 0 || kozb.back() % 17 == 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
base58/60
1Accepted0/03ms1828 KiB
2Accepted0/02ms2056 KiB
3Accepted3/32ms2132 KiB
4Accepted3/32ms2232 KiB
5Accepted4/42ms2468 KiB
6Accepted4/42ms2700 KiB
7Accepted4/42ms2744 KiB
8Accepted5/52ms2848 KiB
9Accepted5/52ms3048 KiB
10Accepted5/52ms3128 KiB
11Accepted5/52ms3128 KiB
12Accepted6/62ms3132 KiB
13Accepted6/62ms3128 KiB
14Accepted6/62ms3228 KiB
15Accepted2/22ms3508 KiB
16Wrong answer0/22ms3408 KiB