fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. const long MODn = 1000000033LL;
  6. int d;
  7. cin >> d;
  8. long sum = 0;
  9.  
  10. long pot_2 = 1;
  11. for (int i = 1; i <= d; i++) {
  12. pot_2 = (pot_2 * 2) % MODn;
  13. long term = (i % MODn) * pot_2 % MODn;
  14. sum = (sum + term) % MODn;
  15. }
  16. cout << (2 * sum) % MODn << "\n";
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5320KB
stdin
4
stdout
196