Submission #784546

# Submission time Handle Problem Language Result Execution time Memory
784546 2023-07-16T08:26:40 Z Trisanu_Das Toys (CEOI18_toy) C++17
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

set<int> ans;

void res(int n, int last, int sum){
  ans.insert(sum - n + 1);
  for(int i = last; i <= n / i; i++) if(n % i == 0) res(n / i, i, sum + i - 1);
}

int main(){
  int n; cin >> n;
  res(n, 2, 0);
  cout << ans.size() << '\n';
  for(int x : ans) cout << x << '\n';
  cout << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -