Advertisement
artemgf

Отважные воздухоплаватели

Dec 2nd, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #define _USE_MATH_DEFINES
  3. #include <iostream>
  4. #include <string>
  5. #include <algorithm>
  6. #include <vector>
  7. #include <map>
  8. #include <queue>
  9. #include <set>
  10. #include <stack>
  11.  
  12. using namespace std;
  13.  
  14. typedef long long ll;
  15. vector<ll> mas(100001,0);
  16. void prost(ll num)
  17. {
  18.     ll sc = 1;
  19.     ll p = 0;
  20.     for (int i = 2; i <= num; i++)
  21.     {
  22.         p = 0;
  23.         while (num%i==0)
  24.         {
  25.             num /= i;
  26.             p++;
  27.         }
  28.         mas[i] += p;
  29.     }
  30. }
  31. int main()
  32. {
  33.     //freopen("input.txt", "rt", stdin);
  34.     //freopen("output.txt", "wt", stdout);
  35.  
  36.     ll answ=1;
  37.     ll prom;
  38.     for (int i = 1; i <= 10; i++)
  39.     {
  40.         cin >> prom;
  41.         prost(prom);
  42.     }
  43.     for (int i = 1; i <= 100000; i++)
  44.     {
  45.         if (mas[i] != 0)
  46.         {
  47.             answ *= (mas[i] + 1);
  48.             answ %= 10;
  49.         }
  50.     }
  51.     cout << answ;
  52.     system("pause");
  53.     return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement