171392025-05-24 13:34:00CodeWarriorOszthatóság 17-tel (60 pont)cpp17Wrong answer 58/601ms520 KiB
// #include <iostream>

// using namespace std;

// int main()
// {
//     long long n, sz[10], k = 0;
//     cin >> n;

//     n = (n / 10) - (n % 10 * 5);
//     while (n > 0)
//     {
//         sz[k++] = n;
//         n = (n / 10) - (n % 10 * 5);
//     }

//     if (k == 0 && n == 0)
//         cout << "IGEN\n"
//              << 0;
//     else
//     {
//         if (k > 0 && sz[k - 1] % 17 == 0)
//         {
//             cout << "IGEN\n";
//         }
//         else
//             cout << "NEM\n";
//     }

//     for (int i = 0; i < k; i++)
//     {
//         cout << sz[i] << " ";
//     }

//     return 0;
// }

#include <iostream>
#include <vector>

using namespace std;

int main()
{
    long long n;
    cin >> n;

    vector<long long> steps;

    while (n > 0)
    {
        long long lastDigit = n % 10;
        long long rest = n / 10;
        long long next = rest - lastDigit * 5;

        if (next < 0)
            break;

        steps.push_back(next);
        n = next;
    }

    if (!steps.empty() && steps.back() % 17 == 0)
        cout << "IGEN" << endl;
    else
        cout << "NEM" << endl;

    for (long long x : steps)
        cout << x << " ";

    cout << endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base58/60
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted3/31ms316 KiB
4Accepted3/31ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms316 KiB
7Accepted4/41ms316 KiB
8Accepted5/51ms316 KiB
9Accepted5/51ms392 KiB
10Accepted5/51ms316 KiB
11Accepted5/51ms316 KiB
12Accepted6/61ms520 KiB
13Accepted6/61ms508 KiB
14Accepted6/61ms508 KiB
15Accepted2/21ms316 KiB
16Wrong answer0/21ms316 KiB