Sponsors

Tag: problem: (A) Restaurant Tables Solve in C/C++

Codeforces Round #423 (Div....

#include <iostream> using namespace std; int main() { int n,a,b,bg=0,d=0,x; cin>>n>>a>>b; while(n--){ cin>>x; if(x==1) {if(a)a--; else if(b)b--,bg++; else if(bg)bg--; else d++; } else...

Advertisement

spot_img