Something weird with this qn - 248A - Cupboards??
Revision en1, by sicada, 2022-07-01 08:07:52

Hi! This is my first post. For the problem 248- A I think I am submitting a correct code but it doesn't work our for some reason . Can someone help me figure out why? This is my code :

define ll long long int

define rep(i,t) for(i=0;i<t;i++)

define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

define vii vector


using namespace std; int main(){ IOS; ll n,i,l,r,t,sum,mum,leftopen,leftclosed,rightopened,rightclosed; cin>>n; rep(i,n){ cin>>l>>r; sum+=l; mum+=r; } cout<< (min(sum,n-sum) + min(mum,n-mum));



  Rev. Lang. By When Δ Comment
en1 English sicada 2022-07-01 08:07:52 656 Initial revision (published)