Skip to content

Commit

Permalink
Merge pull request #195 from johmn123-wq/igh
Browse files Browse the repository at this point in the history
Era
  • Loading branch information
viveakrt authored Jan 13, 2022
2 parents b18a5b6 + f19e71b commit 7612816
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
24 changes: 24 additions & 0 deletions CodeChef/PROBCAT_Problem_Category.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
https://github.com/johmn123-wq/Competitive-programing.gitv

#include <iostream>
using namespace std;

int main() {
int t;cin>>t;
while(t--){
int x; cin>>x;


if(x>=1 && x<100)
cout<<"Easy";
else if(x>=100 && x<200)
cout<<"Medium";
else if(x>=200 && x<=300)
cout<<"Hard";

cout<<endl;

}

return 0;
}
25 changes: 25 additions & 0 deletions Codeforces/1604A_Era.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// / Problem link : https://codeforces.com/contest/1604/problem/A

#include <bits/stdc++.h>
using namespace std;
int main(){

int t;cin>>t;
while(t--){

int n,cnt=0;
cin>>n;
long long sum=0;
vector<int>v(n+1);
for(int i=1;i<=n;i++){
cin>>v[i];

if(v[i]>i+cnt){
sum+=v[i]-(i+cnt);
cnt+=v[i]-(i+cnt);
}
}
cout<<sum<<endl;
}
return 0;
}

0 comments on commit 7612816

Please sign in to comment.