fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <algorithm>
  5. #include <cmath>
  6.  
  7. using namespace std;
  8.  
  9. typedef unsigned long long int ULL;
  10. typedef long long LL;
  11. typedef long double LD;
  12.  
  13. const ULL mod = 1000000007;
  14.  
  15.  
  16. int main()
  17. {
  18. LL ans = 99*99;
  19. LL nn = 100;
  20.  
  21. vector<vector<LL>> done(nn+1, vector<LL> (nn+1, 0));
  22.  
  23. for (int a = 2; a <= nn; ++a) {
  24. for (int b = 2; b <= nn; ++b) {
  25. if (!done[a][b]) {
  26. LL cnt = 0;
  27. LL x = a;
  28. done[a][b] = 1;
  29. for (int i = 1; i <= b && x <= nn; ++i) {
  30. if (b % i == 0) {
  31. cnt++;
  32. done[x][b/i]++;
  33. }
  34.  
  35. x *= a;
  36. }
  37. ans -= cnt-1;
  38. }
  39.  
  40. }
  41. }
  42. cout << ans << endl;
  43. }
Success #stdin #stdout 0s 4444KB
stdin
Standard input is empty
stdout
9248