7452022-01-05 16:56:02seprbarOszthatóság 31-gyelcpp11Wrong answer 25/503ms2296 KiB
// Oszthatosag 31-el

#include <bits/stdc++.h>
using namespace std;

#define f(N) (((N)-((N)%10))/10) 
#define l(N) (N%10)

void ls(vector <long> v) {
	for (const long& i : v) {
		cout << i << " ";
	}
}

int main () {	
	// Measure execution speed (1)
	clock_t start, end;
	
	long N;
	vector <long> steps;
	cin >> N;
		
	// Measure execution speed (2)
	start = clock();
	
	while (N > 0) {
		N = f(N)-3*l(N);
		steps.push_back(N);
	}
	if (N == 0) {
		cout << "IGEN\n";
		ls(steps);
	}
	else cout << "NEM";
	
	// Measure execution speed (3)
	end = clock();
	double time_taken = double (end - start);
	cout << "\n( " << time_taken << " / " << CLOCKS_PER_SEC << " = " << time_taken / CLOCKS_PER_SEC << " sec )\n";
}
SubtaskSumTestVerdictTimeMemory
base25/50
1Accepted0/03ms2200 KiB
2Wrong answer0/01ms2248 KiB
3Wrong answer0/32ms2244 KiB
4Accepted3/32ms2240 KiB
5Accepted4/41ms2244 KiB
6Wrong answer0/42ms2256 KiB
7Wrong answer0/42ms2264 KiB
8Accepted4/41ms2268 KiB
9Accepted4/42ms2272 KiB
10Wrong answer0/42ms2264 KiB
11Accepted4/41ms2276 KiB
12Wrong answer0/41ms2280 KiB
13Wrong answer0/42ms2284 KiB
14Accepted4/41ms2288 KiB
15Accepted2/21ms2292 KiB
16Wrong answer0/21ms2296 KiB