Codeforces 1326B. Maximums Solution

  1. Solution in c++:
         ///**********ALLAH IS ALMIGHTY************///
         ///AH Tonmoy
        ///Department of CSE,23rd batch
        ///Islamic University,Bangladesh
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main()
  5. {
  6.  
  7. int v,n,c,r,t,i;
  8. while(cin>>t)
  9. {
  10. c=0;
  11. for(i=0; i<t; i++)
  12. {
  13. cin>>n;
  14. cout<<n+c<<" ";
  15. if(c<n+c)
  16. {
  17. c=n+c;
  18. }
  19. }
  20. cout<<endl;
  21. }
  22. }

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.