From d8a72bf7e6ea4fc204c587ce0480423dce271656 Mon Sep 17 00:00:00 2001 From: ShazidMahsrafi Date: Fri, 18 Aug 2023 17:13:14 +0600 Subject: [PATCH] initial commit --- 349A Cinema Line/349A.cpp | 81 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 349A Cinema Line/349A.cpp diff --git a/349A Cinema Line/349A.cpp b/349A Cinema Line/349A.cpp new file mode 100644 index 0000000..a3bd54e --- /dev/null +++ b/349A Cinema Line/349A.cpp @@ -0,0 +1,81 @@ +#include +using namespace std; + +#define ll long long +#define ul unsigned long long +#define pb push_back +#define ss second +#define ff first +#define fr(m) for(int i=0; i=0; i--) +#define nl '\n' +#define yes cout<<"YES"<>n; + int hand25=0; + int hand50=0; + fr(n) + { + int x; + cin>>x; + if(x==25) + hand25++; + else if(x==50) + { + hand50++; + hand25--; + if(hand25<0) + { + no; + return; + } + } + else if(x==100) + { + if(hand50) + { + hand50--; + hand25--; + } + else + hand25-=3; + if(hand25<0) + { + no; + return; + } + } + } + yes; +} + +int main() +{ + fast_io; + int TC = 1; + //cin >> TC; + while (TC--) solve(); +} \ No newline at end of file