Source code for submission s815

Go to diff to previous submission

fl.cpp

  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4. #include <cstdio>
  5. #include <vector>
  6.  
  7. using namespace std;
  8.  
  9. int main ()
  10. {
  11. unsigned long n, x, y, pocet;
  12. n = x = y = pocet = 0;
  13. string input;
  14. vector<unsigned long> pouzite;
  15.  
  16. while (cin)
  17. {
  18. cin >> input;
  19. if (input.empty()) break;
  20. n = atoi(input.c_str()+2);
  21. x = n+1;
  22. if (n == 0)
  23. {
  24. cout << 0 << "\n";
  25. continue;
  26. }
  27. if (n == 1)
  28. {
  29. cout << 1 << "\n";
  30. continue;
  31. }
  32. while (true)
  33. {
  34. if((x*n)%(x-n)==0)
  35. {
  36. y = x*n/(x-n);
  37. if (y < x) break;
  38. /*nasel = false;
  39.   for (vector<unsigned long>::iterator i = pouzite.begin(); i != pouzite.end(); i++)
  40.   {
  41.   if ((*i) == y)
  42.   {
  43.   nasel = true;
  44.   break;
  45.   }
  46.   }
  47.   if (!nasel)
  48.   {
  49.   pouzite.push_back(x);
  50.   }*/
  51. pocet++;
  52.  
  53. if (y == x) break;
  54. }
  55. x++;
  56. }
  57. y = 0;
  58. x = 0;
  59. cout << pocet << "\n";
  60. pocet = 0;
  61. }
  62. return 0;
  63. }
  64.  

Diff to submission s808

f1.cpp

--- c5.s808.cteam016.fl.cpp.0.f1.cpp
+++ c5.s815.cteam016.fl.cpp.0.fl.cpp
@@ -13,5 +13,4 @@
  string input;
  vector<unsigned long> pouzite;
- bool nasel = false;
 
  while (cin)