69792023-12-23 18:28:51MagyarKendeSZLGOszthatóság 31-gyelcpp17Runtime error 44/504ms3960 KiB
#include <iostream>
#include <vector>
#include <string>
#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());
        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/03ms1824 KiB
2Accepted0/03ms2056 KiB
3Accepted3/33ms2268 KiB
4Accepted3/33ms2608 KiB
5Accepted4/43ms2784 KiB
6Accepted4/43ms2852 KiB
7Accepted4/43ms3084 KiB
8Accepted4/43ms3192 KiB
9Accepted4/43ms3684 KiB
10Accepted4/43ms3436 KiB
11Accepted4/43ms3544 KiB
12Runtime error0/44ms3960 KiB
13Accepted4/43ms3544 KiB
14Accepted4/43ms3468 KiB
15Accepted2/23ms3464 KiB
16Wrong answer0/23ms3568 KiB