72 | 2021. 01. 10 10:59:42 | Tiszay Dávid | Oszthatóság 37-tel | cpp11 | Wrong answer 33/40 | 2ms | 1912 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 && ok) {
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();
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
base | 33/40 | ||||||
1 | Accepted | 0/0 | 2ms | 1756 KiB | |||
2 | Accepted | 0/0 | 1ms | 1784 KiB | |||
3 | Accepted | 3/3 | 1ms | 1860 KiB | |||
4 | Accepted | 3/3 | 1ms | 1864 KiB | |||
5 | Accepted | 3/3 | 1ms | 1868 KiB | |||
6 | Accepted | 3/3 | 1ms | 1888 KiB | |||
7 | Accepted | 3/3 | 1ms | 1864 KiB | |||
8 | Accepted | 3/3 | 1ms | 1896 KiB | |||
9 | Accepted | 3/3 | 1ms | 1884 KiB | |||
10 | Accepted | 3/3 | 1ms | 1904 KiB | |||
11 | Accepted | 3/3 | 1ms | 1892 KiB | |||
12 | Accepted | 3/3 | 1ms | 1896 KiB | |||
13 | Accepted | 3/3 | 1ms | 1884 KiB | |||
14 | Wrong answer | 0/3 | 1ms | 1904 KiB | |||
15 | Wrong answer | 0/2 | 1ms | 1908 KiB | |||
16 | Runtime error | 0/2 | 1ms | 1912 KiB |