Source code for submission s464

fl.cpp

  1. #include <stdio.h>
  2. #include <vector>
  3. using namespace std;
  4. int main() {
  5. int n;
  6. char tmp, tmp2;
  7. while(scanf("%c%c%d\n", &tmp, &tmp2, &n) == 3) {
  8. int ans = 0;
  9. int ans2 = 0;
  10. for(int x = 1; x < 10000*n; x++) {
  11. long long prod = x*n;
  12. if(x == n) continue;
  13. if(prod % (x-n) == 0) {
  14. long long y = prod/(x-n);
  15. if(x > 0 && y > 0) {
  16. if(x == y)
  17. ans2++;
  18. else ans++;
  19. }
  20. }
  21. }
  22. printf("%d\n", ans2+ans/2);
  23. }
  24. }
  25.