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 T> struct cLtraits_identity{
  7. using type = T;
  8. }
  9. ;
  10. template<class T> using cLtraits_try_make_signed =
  11. typename conditional<
  12. is_integral<T>::value,
  13. make_signed<T>,
  14. cLtraits_identity<T>
  15. >::type;
  16. template <class S, class T> struct cLtraits_common_type{
  17. using tS = typename cLtraits_try_make_signed<S>::type;
  18. using tT = typename cLtraits_try_make_signed<T>::type;
  19. using type = typename common_type<tS,tT>::type;
  20. }
  21. ;
  22. template<class S, class T> inline auto min_L(S a, T b)
  23. -> typename cLtraits_common_type<S,T>::type{
  24. return (typename cLtraits_common_type<S,T>::type) a <= (typename cLtraits_common_type<S,T>::type) b ? a : b;
  25. }
  26. #define main dummy_main
  27. int main(){
  28. return 0;
  29. }
  30. #undef main
  31. class Solution{
  32. public:
  33. long long maxRunTime(int N, vector<int>& E){
  34. int M = E.size();
  35. long long Nzj9Y0kE;
  36. long long bkxOPzPX;
  37. long long WKqLrJHZ;
  38. Nzj9Y0kE = 0;
  39. bkxOPzPX = 1000000000000000LL;
  40. while(Nzj9Y0kE < bkxOPzPX){
  41. if((Nzj9Y0kE + bkxOPzPX)%2==0){
  42. WKqLrJHZ = (Nzj9Y0kE + bkxOPzPX) / 2;
  43. }
  44. else{
  45. WKqLrJHZ = (Nzj9Y0kE + bkxOPzPX + 1) / 2;
  46. }
  47. int bs24PFPc;
  48. long long R5MtCiij;
  49. int YGwFZBGH = 0;
  50. if((0) > ((M)-1)){
  51. R5MtCiij = 0;
  52. }
  53. else{
  54. for(bs24PFPc = 0; bs24PFPc <= (M)-1; bs24PFPc++){
  55. if(YGwFZBGH == 0){
  56. R5MtCiij =min_L(WKqLrJHZ, E[bs24PFPc]);
  57. YGwFZBGH = 1;
  58. continue;
  59. }
  60. R5MtCiij +=min_L(WKqLrJHZ, E[bs24PFPc]);
  61. }
  62. if(YGwFZBGH==0){
  63. R5MtCiij = 0;
  64. }
  65. }
  66. if(R5MtCiij/ N >= WKqLrJHZ){
  67. Nzj9Y0kE = WKqLrJHZ;
  68. }
  69. else{
  70. bkxOPzPX = WKqLrJHZ - 1;
  71. }
  72. }
  73. return bkxOPzPX;
  74. }
  75. }
  76. ;
  77. // cLay version 20220116-1
  78.  
  79. // --- original code ---
  80. // #define main dummy_main
  81. // {}
  82. // #undef main
  83. //
  84. // class Solution {
  85. // public:
  86. // ll maxRunTime(int N, VI& E){
  87. // int M = E.size();
  88. // return bsearch_max[ll,x,0,1d15](sum[ll][i,0,M](min(x,E[i])) / N >= x);
  89. // }
  90. // };
  91.  
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