712021-01-10 10:57:41Tiszay DávidOszthatóság 37-telcpp11Wrong answer 33/402ms1896 KiB
#include <bits/stdc++.h>
using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define flog(n) 31-__builtin_clz((n))
#define clog(n) 32-__builtin_clz((n)-1)
#define fori(i,a,b) for(long long int i=(a);i<=(b);i++)
#define forib(i,a,b) for(long long int i=(a);i>=(b);i--)
using ll=long long; using pi=pair<int,int>; using vi=vector<int>; using vl=vector<ll>;


void solve(){
  ll n; cin >> n;
  bool ok = false;
  vl curr;
  while (true){
    ll m = n % 10;
    ll neu = n / 10 - m * 11;
    if (neu <= 0){
        if (n % 37 == 0){
            ok = true;
        }
        break;
    }
    n = neu;
    curr.pb(neu);
  }
  cout << (ok ? "IGEN" : "NEM") << endl;
  if (curr.size() == 0) {
    cout << 0 << " ";
  } else {
      fori(i, 0, curr.size() - 1){
          cout << curr[i] << " ";
      }
  }
  cout << endl;
}
int main() {
  if(true){ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);}
  solve();
}
SubtaskSumTestVerdictTimeMemory
base33/40
1Accepted0/01ms1804 KiB
2Accepted0/01ms1784 KiB
3Accepted3/31ms1868 KiB
4Accepted3/31ms1852 KiB
5Accepted3/31ms1860 KiB
6Accepted3/31ms1860 KiB
7Accepted3/31ms1868 KiB
8Accepted3/31ms1868 KiB
9Accepted3/32ms1884 KiB
10Accepted3/32ms1880 KiB
11Accepted3/31ms1880 KiB
12Accepted3/31ms1884 KiB
13Accepted3/31ms1892 KiB
14Wrong answer0/31ms1896 KiB
15Wrong answer0/21ms1892 KiB
16Wrong answer0/21ms1896 KiB