49092023-04-06 20:18:47balaaaazsOszthatóság 31-gyelcpp14Runtime error 44/504ms3932 KiB
#include <iostream>
#include <string>
using namespace std;

int main()
{
	string N;
	cin >> N;
	int utolso = N[N.length()-1]-48;
	if (stoi(N) % 31 == 0)
		cout << "IGEN\n";
	else
		cout << "NEM\n";
	N.erase(N.end() - 1, N.end());
	int szam = stoi(N) - 3 * utolso;
	while (szam > 0)
	{
		cout << szam<<" ";
		N = to_string(szam);
		utolso = N[N.length() - 1] - 48;
		N.erase(N.end() - 1, N.end());
		szam = stoi(N) - 3 * utolso;
	}
	if (szam == 0)
		cout << "0";
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base44/50
1Accepted0/03ms1808 KiB
2Accepted0/03ms2004 KiB
3Accepted3/33ms2084 KiB
4Accepted3/33ms2220 KiB
5Accepted4/43ms2464 KiB
6Accepted4/43ms2648 KiB
7Accepted4/43ms2888 KiB
8Accepted4/43ms2964 KiB
9Accepted4/43ms2968 KiB
10Accepted4/43ms3064 KiB
11Accepted4/43ms3328 KiB
12Runtime error0/44ms3932 KiB
13Accepted4/43ms3604 KiB
14Accepted4/42ms3588 KiB
15Accepted2/22ms3700 KiB
16Wrong answer0/23ms3860 KiB