fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <vector>
  5. #include <cmath>
  6. #include <queue>
  7. #include <functional>
  8. using namespace std;
  9.  
  10. class MulticoreProcessing {
  11. public:
  12. long long fastestTime(long long N, int M, vector <int> speed, vector <int> cores) {
  13. long long ret = (1LL << 60), MM = M;
  14. for (int i = 0; i < speed.size(); i++) {
  15. long long L = 1, R = (1LL << 30), U, maxn = 0;
  16. for (int j = 0; j < 34; j++) {
  17. U = (L + R) / 2;
  18. if ((N / (U*(U + 1))) < MM) { R = U; }
  19. else { L = U; maxn = max(maxn, U); }
  20. }
  21. long long I = min(1LL * cores[i], max(1LL, U));
  22. long long J = ((N - 1) / (1LL * speed[i] * I)) + 1LL; J += (I - 1)*MM;
  23. ret = min(ret, J);
  24. }
  25. return ret;
  26. }
  27. };
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty