|
|
back to boardWhy wrong answer? Posted by Ferro 16 Apr 2022 18:44 #include <iostream> #include <vector> using namespace std; int main() { int n, s; cin >> n >> s; vector<int> nums(n + 1, 1); for (int i = s; i <= n; i++) { for (int j = 101; j <= 200; j++) { if ((i * j) % 100 == 0 and (i * j) / 100 <= n) { nums[(i * j) / 100] = nums[(i * j) / 100] > nums[i] + 1 ? nums[(i * j) / 100] : nums[i] + 1; } } } cout << nums[n] << endl; return 0; } |
|
|