From d6f2493f2c47031e0da57d8cf244ed7c48cd789e Mon Sep 17 00:00:00 2001 From: Neil Villamizar Date: Tue, 6 Oct 2020 19:00:55 -0400 Subject: [PATCH] Add solution to HISTOGRA problem from spoj --- histogra.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 histogra.cpp diff --git a/histogra.cpp b/histogra.cpp new file mode 100644 index 0000000..62ea698 --- /dev/null +++ b/histogra.cpp @@ -0,0 +1,60 @@ + #include + #include + #include + #include + #include + #include + #include + #include + + using namespace std; + + #define FOR(i,n,m) for(int i=n; im; i--) + #define pb push_back + #define ll long long + #define ri(a) scanf("%d",&a) + #define rii(a,b) scanf("%d %d",&a,&b) + + + /*-------------------------------------------------------------------------------------------------------------------------------------- + --------------------------------------------------------------------------------------------------------------------------------------*/ + ll n,ans,i; + ll a[200005]; + + int main() + { + //ios_base::sync_with_stdio(false); + //cin.tie(NULL); + + cin>>n; + + while(n!=0){ + + FOR(j,0,n) cin>>a[j]; + + ans=0,i=0; stack s; + + while(i>n; + } + + }