32202023-02-22 18:05:53horvathabelOszthatóság 31-gyelcpp17Accepted 50/503ms4000 KiB
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
	ll n;
	cin>>n;
	vector<ll> ans; 
	if (n==0) ans.push_back(0); 
	while (n>0){
		int x=n%10;
		n=n/10;
		n-=x*3;
		ans.push_back(n);
	}
	if (n==0){
		cout<<"IGEN"<<endl;
		for (auto x:ans) cout<<x<<" "; 
	}
	else{
		cout<<"NEM"<<endl;
		if (ans.size()==1) cout<<endl; 
		for (int i=0; i<ans.size()-1;i++) cout<<ans[i]<<" ";  
	}
	 
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/03ms1808 KiB
2Accepted0/03ms2060 KiB
3Accepted3/33ms2216 KiB
4Accepted3/33ms2432 KiB
5Accepted4/43ms2640 KiB
6Accepted4/43ms2852 KiB
7Accepted4/43ms3068 KiB
8Accepted4/43ms3304 KiB
9Accepted4/43ms3516 KiB
10Accepted4/43ms3640 KiB
11Accepted4/42ms3604 KiB
12Accepted4/43ms3688 KiB
13Accepted4/43ms3816 KiB
14Accepted4/43ms3912 KiB
15Accepted2/22ms4000 KiB
16Accepted2/23ms3996 KiB