1272021-01-16 18:23:03TachiOszthatóság 31-gyelcpp11Wrong answer 48/502ms1828 KiB
#include <iostream>
#include <vector>
using namespace std;

int main() {
  int n;
  cin >> n;
  if (n == 0){
    cout << "IGEN\n" << n;
    return 0;
  }
  vector<int> mo;
  for (int i = 0; ; i++){
    if (i == 0){
      mo.push_back(n);
    }
    else {
      mo.push_back(mo[i - 1] / 10 - (mo[i - 1] % 10) * 3);
    }
    if (mo[i] == 0){
      cout << "IGEN\n";
      break;
    }
    else if (mo[i] < 0){
      cout << "NEM\n";
      break;
    }
  }
  for (int i = 1; i < 10; i++){
    if (mo[i] >= 0)
    cout << mo[i] << " ";
    if (mo[i] <= 0){
      break;
    }
  }
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base48/50
1Accepted0/02ms1744 KiB
2Accepted0/01ms1764 KiB
3Accepted3/31ms1720 KiB
4Accepted3/31ms1828 KiB
5Accepted4/41ms1824 KiB
6Accepted4/41ms1828 KiB
7Accepted4/41ms1720 KiB
8Accepted4/41ms1824 KiB
9Accepted4/41ms1824 KiB
10Accepted4/41ms1824 KiB
11Accepted4/41ms1824 KiB
12Accepted4/41ms1824 KiB
13Accepted4/41ms1720 KiB
14Accepted4/41ms1824 KiB
15Accepted2/21ms1824 KiB
16Wrong answer0/21ms1828 KiB