diff options
Diffstat (limited to 'contests/05-05-2022(Div.3)')
| -rwxr-xr-x | contests/05-05-2022(Div.3)/A/A | bin | 0 -> 17848 bytes | |||
| -rw-r--r-- | contests/05-05-2022(Div.3)/A/A.cpp | 42 | ||||
| -rwxr-xr-x | contests/05-05-2022(Div.3)/B/B | bin | 0 -> 33024 bytes | |||
| -rw-r--r-- | contests/05-05-2022(Div.3)/B/B.cpp | 48 | ||||
| -rw-r--r-- | contests/05-05-2022(Div.3)/C/C.cpp | 1 | ||||
| -rwxr-xr-x | contests/05-05-2022(Div.3)/C/C.py | 17 | ||||
| -rw-r--r-- | contests/05-05-2022(Div.3)/D/D.cpp | 0 | ||||
| -rw-r--r-- | contests/05-05-2022(Div.3)/E/E.cpp | 0 | ||||
| -rw-r--r-- | contests/05-05-2022(Div.3)/F/F.cpp | 0 |
9 files changed, 108 insertions, 0 deletions
diff --git a/contests/05-05-2022(Div.3)/A/A b/contests/05-05-2022(Div.3)/A/A Binary files differnew file mode 100755 index 0000000..7c1c04e --- /dev/null +++ b/contests/05-05-2022(Div.3)/A/A diff --git a/contests/05-05-2022(Div.3)/A/A.cpp b/contests/05-05-2022(Div.3)/A/A.cpp new file mode 100644 index 0000000..2f5fb6b --- /dev/null +++ b/contests/05-05-2022(Div.3)/A/A.cpp @@ -0,0 +1,42 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main() { + int tt,a,b,c,x,y,remX,remY; + cin >> tt; + while (tt--) { + cin >> a >> b >> c >> x >> y; + if(a > x && b < y) { + remX = 0; + remY = y - b; + } + else if (a < x && b > y) { + remX = x - a; + remY = 0; + } + else if (a > x && b > y) { + remX =0; + remY =0; + } + else { + remX = x - a; + remY = y - b; + } + if(c == 0) { + if(a >= x && b >= y) { + cout << "YES" << endl; + } + else { + cout << "NO" << endl; + } + } + else if(c >= remX + remY) { + cout << "YES" << endl; + } + else { + cout << "NO" << endl; + } + + } +} diff --git a/contests/05-05-2022(Div.3)/B/B b/contests/05-05-2022(Div.3)/B/B Binary files differnew file mode 100755 index 0000000..af9715e --- /dev/null +++ b/contests/05-05-2022(Div.3)/B/B diff --git a/contests/05-05-2022(Div.3)/B/B.cpp b/contests/05-05-2022(Div.3)/B/B.cpp new file mode 100644 index 0000000..27c4853 --- /dev/null +++ b/contests/05-05-2022(Div.3)/B/B.cpp @@ -0,0 +1,48 @@ +#include<bits/stdc++.h> + +using namespace std; + +bool isIncreasing(vector<int> v){ + for(int i = 0; i < v.size() - 1; i++) { + if(v[i] >= v[i+1]) { + return false; + } + } + return true; +} +int getIndex(vector<int> v){ + int index; + for(int i = 0; i < v.size(); i++) { + vector<int> v2(i+1); + for(int j = 0; j <= i;j++){ + index = j; + v2[j] = v[j]; + } + if(!isIncreasing(v2)) { + return index; + } + } + return -1; +} + +int main () { + int tt, n; + cin >> tt; + while(tt--) { + cin >> n; + vector<int> v(n); + for(auto &x : v) { + cin >> x; + } + int idx = getIndex(v); + vector<int> rem(v.size() - idx); + if(idx == -1) { + cout << "0" << endl; + } else { + for(int i = 0;i < v.size() - idx; i++) { + rem[i] = v[idx + i]; + } + } + } + +} diff --git a/contests/05-05-2022(Div.3)/C/C.cpp b/contests/05-05-2022(Div.3)/C/C.cpp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/contests/05-05-2022(Div.3)/C/C.cpp @@ -0,0 +1 @@ + diff --git a/contests/05-05-2022(Div.3)/C/C.py b/contests/05-05-2022(Div.3)/C/C.py new file mode 100755 index 0000000..422b0f7 --- /dev/null +++ b/contests/05-05-2022(Div.3)/C/C.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +t = int(input()) +while(t): + t-=1 + s = input() + one = 0 + zero = len(s) - 1 + for i in range(len(s)): + if s[i] == '0': + zero = i + break + for i in range(len(s)): + if s[i] == '1': + one = i + print(zero - one + 1) + diff --git a/contests/05-05-2022(Div.3)/D/D.cpp b/contests/05-05-2022(Div.3)/D/D.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/contests/05-05-2022(Div.3)/D/D.cpp diff --git a/contests/05-05-2022(Div.3)/E/E.cpp b/contests/05-05-2022(Div.3)/E/E.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/contests/05-05-2022(Div.3)/E/E.cpp diff --git a/contests/05-05-2022(Div.3)/F/F.cpp b/contests/05-05-2022(Div.3)/F/F.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/contests/05-05-2022(Div.3)/F/F.cpp |
