diff --git a/144A Arrival of the General/144A.cpp b/144A Arrival of the General/144A.cpp new file mode 100644 index 0000000..79cd936 --- /dev/null +++ b/144A Arrival of the General/144A.cpp @@ -0,0 +1,58 @@ +#include +using namespace std; +using ll = long long; + + +void solve() +{ + int n; + cin>>n; + vectorline; + for(int i=0; i>x; + line.push_back(x); + } + int min, min_pos, max, max_pos; + min=max_pos=INT_MAX; + max=min_pos=INT_MIN; + + for(int i=0; imax) + { + max=line[i]; + max_pos=i; + } + } + for(int i=n-1; i>=0; --i) + { + if(line[i]> TC; + //cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file diff --git a/155A - I_love_%username%/155A.cpp b/155A - I_love_%username%/155A.cpp new file mode 100644 index 0000000..4559977 --- /dev/null +++ b/155A - I_love_%username%/155A.cpp @@ -0,0 +1,40 @@ +#include +using namespace std; +using ll = long long; + + +void solve() +{ + int n; + cin>>n; + int best,worst,ct=0; + for(int i=0; i>x; + if(i==0) + best=worst=x; + if(xbest) + { + ct++; + best=x; + } + } + cout<> TC; + //cin.ignore(); + while (TC--) solve(); +} \ No newline at end of file diff --git a/Readme.md b/Readme.md index 1d3488c..9551a89 100644 --- a/Readme.md +++ b/Readme.md @@ -100,7 +100,8 @@ Feel free to check these codes out. | 1850C | Word on the Paper | [Question](https://codeforces.com/contest/1850/problem/C) | | 1851A | Escalator Conversations | [Question](https://codeforces.com/problemset/problem/1851/A) | | 1851B | Parity Sort | [Question](https://codeforces.com/problemset/problem/1851/B) | -| 1853A | Desorting | [Question](https://codeforces.com/contest/1853/problem/A) +| 1853A | Desorting | [Question](https://codeforces.com/contest/1853/problem/A) | +| 1855A | Dalton the Teacher | [Question](https://codeforces.com/contest/1855/problem/A) |