fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int mod = 2023;
  5.  
  6. int main() {
  7. int cnt = 0, first_half = 1;
  8. for (int m = 1; m < 15000; ++m) {
  9.  
  10. int second_half = 1;
  11. for (int n = 1; m + n <= 15000; ++n) {
  12. second_half = (second_half * 10) % mod;
  13. cnt += ((first_half * second_half) % mod == 0);
  14. }
  15.  
  16. first_half = (first_half * 10) % mod;
  17. first_half = (first_half + 1) % mod;
  18. }
  19. cout << cnt << '\n';
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0.56s 5256KB
stdin
Standard input is empty
stdout
130464