8512022-01-20 21:58:37Halasz EszterOszthatóság 31-gyelcpp11Wrong answer 48/502ms1960 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 && n!=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
base48/50
1Accepted0/02ms1808 KiB
2Accepted0/01ms1844 KiB
3Accepted3/31ms1904 KiB
4Accepted3/31ms1912 KiB
5Accepted4/41ms1916 KiB
6Accepted4/41ms1920 KiB
7Accepted4/41ms1924 KiB
8Accepted4/41ms1928 KiB
9Accepted4/41ms1928 KiB
10Accepted4/41ms1932 KiB
11Accepted4/41ms1936 KiB
12Accepted4/41ms1948 KiB
13Accepted4/42ms1948 KiB
14Accepted4/41ms1952 KiB
15Accepted2/21ms1952 KiB
16Wrong answer0/21ms1960 KiB