49102023-04-06 20:20:48balaaaazsOszthatóság 31-gyelcpp14Runtime error 44/504ms3968 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/03ms1812 KiB
2Accepted0/03ms2052 KiB
3Accepted3/33ms2308 KiB
4Accepted3/33ms2516 KiB
5Accepted4/43ms2680 KiB
6Accepted4/42ms2760 KiB
7Accepted4/43ms2968 KiB
8Accepted4/42ms2968 KiB
9Accepted4/43ms3076 KiB
10Accepted4/43ms3316 KiB
11Accepted4/42ms3400 KiB
12Runtime error0/44ms3904 KiB
13Accepted4/43ms3520 KiB
14Accepted4/43ms3644 KiB
15Accepted2/23ms3852 KiB
16Wrong answer0/22ms3968 KiB