Submission #493217

#TimeUsernameProblemLanguageResultExecution timeMemory
493217blueToys (CEOI18_toy)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> #include <set> using namespace std; #define sz(x) (int(x.size())) int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector<int> res[1+n]; for(int i = 1; i <= n; i++) { res[i].push_back(i-1); for(int j = 1; j < i; j++) { if(i % j == 0) { int u = j; int v = i/j; for(int a: res[u]) for(int b: res[v]) res[i].push_back(a+b); // break; } } sort(res[i].begin(), res[i].end()); res[i].erase(unique(res[i].begin(), res[i].end()), res[i].end()); } cout << sz(res[n]) << '\n'; for(int r: res[n]) cout << r << ' '; cout << '\n'; }

Compilation message (stderr)

toy.cpp: In function 'int main()':
toy.cpp:32:9: error: 'sort' was not declared in this scope; did you mean 'qsort'?
   32 |         sort(res[i].begin(), res[i].end());
      |         ^~~~
      |         qsort
toy.cpp:33:22: error: 'unique' was not declared in this scope
   33 |         res[i].erase(unique(res[i].begin(), res[i].end()), res[i].end());
      |                      ^~~~~~