8522022-01-20 22:00:51Halasz EszterOszthatóság 31-gyelcpp11Runtime error 23/5041ms60352 KiB
#include <iostream>
//#include <fstream>
#include <vector>

using namespace std;

//ifstream cin("31el.in");
//ofstream cout("31el.out");

vector<int>x;

int b,n,i;

void oszt(int n)
{
    int a;
    a=n%10;
    n=n/10;
    if(n-3*a>=0 )
    {
        b=n-3*a;
        x.push_back(n-3*a);
        oszt(n-3*a);
    }
}
int main()
{
    cin>>n;
    oszt(n);
    if(b%31==0 && x.size()!=0)
    {
        cout<<"IGEN"<<"\n";
        for(auto e:x) cout<<e<<" ";
    }
    else
    {
        cout<<"NEM"<<"\n";
        for(auto e:x) cout<<e<<" ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base23/50
1Runtime error0/035ms60156 KiB
2Accepted0/01ms1860 KiB
3Accepted3/31ms1908 KiB
4Runtime error0/334ms60200 KiB
5Runtime error0/432ms60304 KiB
6Accepted4/41ms1920 KiB
7Accepted4/41ms1932 KiB
8Runtime error0/434ms60324 KiB
9Runtime error0/434ms60328 KiB
10Accepted4/41ms1940 KiB
11Runtime error0/432ms60336 KiB
12Accepted4/41ms1948 KiB
13Accepted4/41ms1956 KiB
14Runtime error0/434ms60348 KiB
15Runtime error0/241ms60352 KiB
16Wrong answer0/21ms1968 KiB