Submission #828452

# Submission time Handle Problem Language Result Execution time Memory
828452 2023-08-17T09:43:33 Z shoryu386 Toys (CEOI18_toy) C++17
0 / 100
1 ms 300 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

set<int> recur(int n){
	set<int> ret;
	for (int x = 2; x <= sqrt(n); x++){
		if (n % x == 0) {
			for (auto y : recur(n/x)){
				ret.insert(x-1 + y);
			}
		}
	}
	return ret;
}

main(){
	int n; cin >> n;
	
	set<int> ans = recur(n); cout << ans.size() << '\n';
	for (auto x : ans){
		cout << x << ' ';
	}
}

Compilation message

toy.cpp:18:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   18 | main(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -