fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. char s[100000];
  5. int i, c, j, x, y, r, b = 19001;
  6. vector<int> a;
  7.  
  8. int main() {
  9.  
  10. // Считываем длинное число
  11. for(cin >> s, i = strlen(s) - 1; i >= 0; i--)
  12. a.push_back(s[i] - '0');
  13.  
  14.  
  15. // Деление длинного на короткое
  16. for (c = 0, i = a.size() - 1; i >= 0; --i) {
  17. long long cur = a[i] + c * 1ll * 10;
  18. a[i] = cur / b;
  19. c = cur % b;
  20. }
  21.  
  22. // Удаляем лидирующие нули
  23. while (a.size() > 1 && a.back() == 0) a.pop_back();
  24.  
  25. // Выводим результат
  26. for (i = a.size() - 1; i >= 0; --i)
  27. cout << a[i];
  28. }
Success #stdin #stdout 0s 4528KB
stdin
7876934512121334556867987056645657567567456345345345
stdout
414553682023121654484921165025296435322743873761