69812023-12-23 18:44:30MagyarKendeSZLGOszthatóság 31-gyelcpp17Wrong answer 48/503ms3964 KiB
#include <iostream>
#include <string>
#define speed cin.tie(0); ios::sync_with_stdio(0)

using namespace std;
using ll = long long;

int main() {
    speed;
    ll N;
    cin >> N;
    cout << (N % 31 ? "NEM" : "IGEN") << '\n';
    while (1) {
        string s = to_string(N);
        if (s.size() < 2) return 0;
        N = stoll(s.substr(0, s.size() - 1)) - stoll(s.substr(s.size() - 1)) * 3;
        if (N < 0) break;
        cout << N << ' ';
    }
}
SubtaskSumTestVerdictTimeMemory
base48/50
1Accepted0/03ms1828 KiB
2Accepted0/03ms2020 KiB
3Accepted3/33ms2228 KiB
4Accepted3/33ms2448 KiB
5Accepted4/43ms2928 KiB
6Accepted4/43ms2776 KiB
7Accepted4/43ms2916 KiB
8Accepted4/43ms3116 KiB
9Accepted4/43ms3200 KiB
10Accepted4/43ms3324 KiB
11Accepted4/43ms3536 KiB
12Accepted4/43ms3772 KiB
13Accepted4/43ms3748 KiB
14Accepted4/43ms3836 KiB
15Accepted2/23ms3836 KiB
16Wrong answer0/23ms3964 KiB