fork download
  1. #pragma GCC optimize("Ofast")
  2. #pragma GCC optimize("unroll-loops")
  3. #pragma GCC optimize("inline")
  4. #include<bits/stdc++.h>
  5. using namespace std;
  6. template<class S, class T> inline S divup_L(S a, T b){
  7. return (a+b-1)/b;
  8. }
  9. #define main dummy_main
  10. int main(){
  11. return 0;
  12. }
  13. #undef main
  14. class Solution{
  15. public:
  16. int minSpeedOnTime(vector<int>& D, double hour){
  17. int N = D.size();
  18. int res;
  19. long long H = hour * 100 + 0.5;
  20. long long take;
  21. int Lj4PdHRW;
  22. int KL2GvlyY;
  23. int Q5VJL1cS;
  24. Lj4PdHRW = 1;
  25. KL2GvlyY = 1000000000;
  26. while(Lj4PdHRW < KL2GvlyY){
  27. int i;
  28. if((Lj4PdHRW + KL2GvlyY)%2==0){
  29. Q5VJL1cS = (Lj4PdHRW + KL2GvlyY) / 2;
  30. }
  31. else{
  32. Q5VJL1cS = (Lj4PdHRW + KL2GvlyY - 1) / 2;
  33. }
  34. take = 0;
  35. for(i=(0);i<(N);i++){
  36. take = ((divup_L(take,100))) * 100;
  37. take +=(divup_L((100LL * D[i]),Q5VJL1cS));
  38. }
  39. if(take <= H){
  40. KL2GvlyY = Q5VJL1cS;
  41. }
  42. else{
  43. Lj4PdHRW = Q5VJL1cS + 1;
  44. }
  45. }
  46. res =KL2GvlyY;
  47. if(res==1000000000){
  48. res = -1;
  49. }
  50. return res;
  51. }
  52. }
  53. ;
  54. // cLay version 20210524-1
  55.  
  56. // --- original code ---
  57. // #define main dummy_main
  58. // {}
  59. // #undef main
  60. //
  61. // class Solution {
  62. // public:
  63. // int minSpeedOnTime(vector<int>& D, double hour) {
  64. // int N = D.size(), res;
  65. // ll H = hour * 100 + 0.5, take;
  66. // res = bsearch_min[int,s,1,1d9][
  67. // take = 0;
  68. // rep(i,N){
  69. // take = (take /+ 100) * 100;
  70. // take += (100LL * D[i]) /+ s;
  71. // }
  72. // ](take <= H);
  73. // if(res==1d9) res = -1;
  74. // return res;
  75. // }
  76. // };
  77.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../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