-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from johmn123-wq/igh
Era
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |