51692023-04-20 17:24:26idkOszthatóság 31-gyelcpp11Accepted 50/503ms3640 KiB
#include <iostream>
#include<vector>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int eredmeny,kulonbseg=n,eleje,utolso;
    eredmeny=n;
    vector <int>a;
    do
    {
        eleje=kulonbseg/10;
        utolso=kulonbseg%10;
        kulonbseg=eleje-3*utolso;
        a.push_back(kulonbseg);
    }while(kulonbseg>0);


    if(kulonbseg==0)
    {
        cout<<"IGEN"<<endl;
        for(int i=0;i<a.size();i++)
        {
            cout<<a.at(i)<<" ";
        }
    }

    else
    {
        cout<<"NEM"<<endl;
        for(int i=0;i<a.size();i++)
        {
            if(a.at(i)>=0)
                cout<<a.at(i)<<" ";

        }
    }
    cout<<endl;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1680 KiB
2Accepted0/03ms1848 KiB
3Accepted3/33ms2060 KiB
4Accepted3/33ms2268 KiB
5Accepted4/43ms2480 KiB
6Accepted4/43ms2696 KiB
7Accepted4/42ms2776 KiB
8Accepted4/43ms2912 KiB
9Accepted4/42ms3020 KiB
10Accepted4/43ms3144 KiB
11Accepted4/43ms3308 KiB
12Accepted4/42ms3396 KiB
13Accepted4/42ms3400 KiB
14Accepted4/43ms3636 KiB
15Accepted2/22ms3640 KiB
16Accepted2/22ms3612 KiB