69802023-12-23 18:39:15MagyarKendeSZLGOszthatóság 31-gyelcpp17Wrong answer 44/503ms3572 KiB
#include <iostream>
#include <vector>
#include <string>
#include <unistd.h>
#define speed cin.tie(0); ios::sync_with_stdio(0)

using namespace std;
using ll = long long;

int main() {
    speed;
    vector<ll> v(1);
    cin >> v.back();

    while (0 < v.back()) {
        string s = to_string(v.back());
        if (s.size() < 2) break;
        v.push_back(
            stoll(s.substr(0, s.size() - 1)) - 
            stoll(s.substr(s.size() - 1)) * 3
        );
    }

    if (v.back()) {
        v.pop_back();
        cout << "NEM\n";
    } else {
        cout << "IGEN\n";
    }
    for (int i = 1; i < v.size(); i++) {
        cout << v[i] << ' ';
    }
}
SubtaskSumTestVerdictTimeMemory
base44/50
1Accepted0/03ms1700 KiB
2Accepted0/03ms1864 KiB
3Accepted3/33ms2088 KiB
4Accepted3/33ms2168 KiB
5Accepted4/43ms2304 KiB
6Accepted4/43ms2384 KiB
7Accepted4/43ms2628 KiB
8Accepted4/43ms2788 KiB
9Accepted4/43ms2728 KiB
10Accepted4/43ms2968 KiB
11Accepted4/43ms3172 KiB
12Wrong answer0/43ms3536 KiB
13Accepted4/43ms3572 KiB
14Accepted4/43ms3488 KiB
15Accepted2/23ms3436 KiB
16Wrong answer0/23ms3572 KiB