Advertisement
Hasan1026

Ubiquity

Sep 21st, 2020
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. /*
  2. * @Author: Kabid
  3. * @Date:   {{create_time}}
  4. * @Last Modified by:   Kabid
  5. * @Last Modified time: 2020-09-20 20:58:29
  6. */
  7. #include<bits/stdc++.h>
  8. #include<cstdlib>
  9. using namespace std;
  10. #define ll long long
  11. #define  in(x) scanf("%d",&x);
  12. #define out(x) printf("%d",x);
  13. #define  ins(x)  scanf("%s",x);
  14. #define outs(x) printf("%s",x);
  15. #define lin puts("");
  16. #define _ putchar(' ');
  17.  
  18. int t;       //test cases
  19. ll i, j;     //iterators
  20. ll n, k ,  q,  d, m, c, c1, c2, d1, x; //variables;
  21. ll mx1 = LLONG_MIN, mx2 = LLONG_MIN, mx = LLONG_MIN, mn = LLONG_MAX;        // max min
  22. char s[6], s1, s2;      // string
  23. ll a [1000001], b [200001] ;
  24. bool mox [1000001]; // array
  25. map <int, int > mp;
  26. vector <vector<ll>> vc;
  27. vector <ll> v;
  28. set <ll> st;
  29. bool r;
  30. ll p = 1000000007;
  31.  
  32.  
  33. int main() {
  34.     ios_base::sync_with_stdio(0);
  35.     cin.tie(0);
  36.     //cin >> t; q = t;
  37.     t = 1;
  38.  
  39.     while (t--) {
  40.  
  41.         cin >> n;
  42.         if (n == 1) {
  43.             cout << 0 << endl;
  44.             continue;
  45.         }
  46.        
  47.         ll ans = 1;
  48.         ll ans2 = 1;
  49.         ll ans3 = 1;
  50.         for (i = 1; i <= n ; i++) {
  51.             ans = ((ans ) * 10) % p;
  52.             ans2 = (ans2 * 9) % p;
  53.             ans3 = (ans3 * 8) % p;
  54.         }
  55.         //cout<<ans<<' '<<ans2<<' '<<ans3<<endl;
  56.  
  57.         cout << ((ans -2*ans2 +ans3)%p +p) %p<< endl;
  58.  
  59.  
  60.         //cout<<mod;
  61.     }
  62.  
  63.  
  64.     return 0;
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement