38702023-03-03 12:42:03EyusieOszthatóság 31-gyelcpp17Runtime error 46/504ms4348 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    vector<char> szam;
    string str;
    cin >> str;
    int a;
    int ertek;
    if(!(stoi(str)%31)) cout << "IGEN\n";
    else cout << "NEM\n";
    int kiirt = 0;
    while(true)
    {
        a = str[str.size()-1] - '0';
        str.pop_back();
        ertek = stoi(str);
        ertek-=3*a;
        if(ertek <= 0)
        {
            if(ertek == 0)
            {
                cout << 0;
            }
            if(kiirt == 0) cout << "\n"
;            break;
        }
        str = to_string(ertek);
        cout << str << " ";
        kiirt++;

    }

}
SubtaskSumTestVerdictTimeMemory
base46/50
1Accepted0/03ms1816 KiB
2Accepted0/03ms2052 KiB
3Accepted3/33ms2292 KiB
4Accepted3/33ms2508 KiB
5Accepted4/42ms2588 KiB
6Accepted4/43ms2672 KiB
7Accepted4/43ms2884 KiB
8Accepted4/43ms3052 KiB
9Accepted4/42ms3264 KiB
10Accepted4/42ms3352 KiB
11Accepted4/43ms3596 KiB
12Runtime error0/44ms4240 KiB
13Accepted4/42ms4012 KiB
14Accepted4/42ms4224 KiB
15Accepted2/23ms4232 KiB
16Accepted2/22ms4348 KiB