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. int minOperations(vector<int> &A, vector<int> &B){
  34. int i;
  35. int x = 0;
  36. int y = 0;
  37. int xx;
  38. int yy;
  39. int N = A.size();
  40. for(i=(0);i<(N-1);i++){
  41. xx = (A[i] > A[N-1] || B[i] > B[N-1]);
  42. yy = (B[i] > A[N-1] || A[i] > B[N-1]);
  43. if(xx&&yy){
  44. return -1;
  45. }
  46. auto WKqLrJHZ = ((xx));
  47. auto QAAnbtfa = (( yy));
  48. x+=WKqLrJHZ;
  49. y+=QAAnbtfa;
  50. }
  51. return min_L(x, y+1);
  52. }
  53. }
  54. ;
  55. // cLay version 20240104-1
  56.  
  57. // --- original code ---
  58. // #define main dummy_main
  59. // {}
  60. // #undef main
  61. //
  62. // class Solution {
  63. // public:
  64. // int minOperations(VI &A, VI &B) {
  65. // int x = 0, y = 0, xx, yy, N = A.size();
  66. // rep(i,N-1){
  67. // xx = (A[i] > A[N-1] || B[i] > B[N-1]);
  68. // yy = (B[i] > A[N-1] || A[i] > B[N-1]);
  69. // if(xx&&yy) return -1;
  70. // (x, y) += (xx, yy);
  71. // }
  72. // return min(x, y+1);
  73. // }
  74. // };
  75.  
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