#define Test int t;cin>>t;while(t–)
#define f(i,a,n) for(int i=a;i<n;i++)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define ll long long int
#define endl “\n”
using namespace std;
std::vector<int> v(n) ;
Whats wrong in this code?
if f[i] is never 0 then min2 is INT_MAX. Now when you add them result is in int which causes overflow.
So, you got WA.
but the variable x which stores the total price of team has the data type of long long int.
Compiler executes the expression written on the RHS of
= first a.k.a. r-value and as you can see each of them is of type
int so the result castes into
int which creates overflow, and then compiler assign the value to LHS a.k.a l-value.
is that even possible because we exactly need two more players one to be forward and one to be defender if there is no second player i.e all the player have value “1” i.e forward only the questions condition will not satisfy itself.
have a glance at the below code: https://www.codechef.com/viewsolution/32216961
Yeah then you have to print no. It is not written that there are 2 types of player present.
i guess you stay corrected.