1237.cpp (380B)
1 class Solution { 2 public: 3 vector<vector<int>> findSolution(CustomFunction &customfunction, int z) const { 4 vector<vector<int>> res; 5 for (int x = 1, y = 1000; x <= 1000; ++x) { 6 while (y > 1 && customfunction.f(x, y) > z) 7 y--; 8 if (customfunction.f(x, y) == z) res.push_back({x, y}); 9 } 10 return res; 11 } 12 };