175532025-07-19 12:10:34sarminOszthatóság 17-tel (60 pont)cpp17Runtime error 48/603ms508 KiB
#include <bits/stdc++.h>
using namespace std;

string next(string& s) {
    if (s == "0" || stoi(s) < 0) return "-";
    return to_string(stoi(s.substr(0, s.size()-1)) - (s.back() - '0') * 5);
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    string s; cin >> s;
    vector<string> res;
    bool can = false; bool o = true;
    while (stoi(s) >= 0) {
        if (!o) res.push_back(s);
        else o = false;
        if (stoi(s) % 17 == 0) can = true;
        s = next(s);
        if (s == "-") break;
    }

    cout << (can ? "IGEN" : "NEM") << "\n";
    for (auto& e : res) cout << e << " ";
	
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base48/60
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Runtime error0/33ms316 KiB
4Accepted3/31ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms508 KiB
7Accepted4/41ms424 KiB
8Accepted5/51ms316 KiB
9Accepted5/51ms316 KiB
10Accepted5/51ms316 KiB
11Runtime error0/53ms496 KiB
12Accepted6/61ms508 KiB
13Accepted6/61ms500 KiB
14Accepted6/61ms420 KiB
15Wrong answer0/21ms316 KiB
16Wrong answer0/21ms316 KiB