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 :

include<bits/stdc++.h>

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));

}

History

Revisions

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