diff options
Diffstat (limited to 'contests/Round#788')
| -rwxr-xr-x | contests/Round#788/A(2_pointers)/A(2_pointers).cpp | 29 | ||||
| -rwxr-xr-x | contests/Round#788/A/A.cpp | 50 | ||||
| -rwxr-xr-x | contests/Round#788/B/B.cpp | 7 | ||||
| -rwxr-xr-x | contests/Round#788/C/C.cpp | 7 | ||||
| -rwxr-xr-x | contests/Round#788/D/D.cpp | 7 | ||||
| -rwxr-xr-x | contests/Round#788/E/E.cpp | 7 | ||||
| -rwxr-xr-x | contests/Round#788/F/F.cpp | 7 |
7 files changed, 0 insertions, 114 deletions
diff --git a/contests/Round#788/A(2_pointers)/A(2_pointers).cpp b/contests/Round#788/A(2_pointers)/A(2_pointers).cpp deleted file mode 100755 index 5d56719..0000000 --- a/contests/Round#788/A(2_pointers)/A(2_pointers).cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include<bits/stdc++.h> -using namespace std; -int main () { - int tt; - cin >> tt; - while (tt--) { - int n; - cin >> n; - vector<int> v(n); - for(auto &x : v) { - cin >> x; - } - int l = 0, r = v.size() - 1; - while(r > l) { - while(v[l] < 0) { - l++; - } - while(v[r] > 0) { - r--; - } - if(l > r) break; - v[l] = -v[l]; - v[r] = -v[r]; - } - cout << (is_sorted(v.begin(), v.end()) ? "YES" : "NO"); - } -} - - diff --git a/contests/Round#788/A/A.cpp b/contests/Round#788/A/A.cpp deleted file mode 100755 index ada8036..0000000 --- a/contests/Round#788/A/A.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std; - -string solve(vector<int> v) { - int p = 0; - int n = 0; - for(int i = 0; i < v.size(); i++) { - if(v[i] > 0) { - p++; - } - else{ - n++; - } - } - int loop = min(p, n); - int loop1 = loop; - for(int i = 0; i < v.size(); i++) { - if(v[i] > 0 && loop != 0) { - v[i] = -v[i]; - loop--; - } - } - loop = min(p, n); - for(int i = v.size() - 1; i > 0; i--) { - if(v[i] < 0 && loop1 != 0) { - v[i] = -v[i]; - loop1--; - } - } - if(is_sorted(v.begin(), v.end())) { - return "YES"; - } - return "NO"; -} - - -int main () { - int tt; - cin >> tt; - while (tt--) { - int n; - cin >> n; - vector<int> v(n); - for(auto &x : v) { - cin >> x; - } - cout << solve(v) << endl; - } -} diff --git a/contests/Round#788/B/B.cpp b/contests/Round#788/B/B.cpp deleted file mode 100755 index 02b1493..0000000 --- a/contests/Round#788/B/B.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std; - -int main () { - -} diff --git a/contests/Round#788/C/C.cpp b/contests/Round#788/C/C.cpp deleted file mode 100755 index f7133e4..0000000 --- a/contests/Round#788/C/C.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std - -int main () { - -} diff --git a/contests/Round#788/D/D.cpp b/contests/Round#788/D/D.cpp deleted file mode 100755 index f7133e4..0000000 --- a/contests/Round#788/D/D.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std - -int main () { - -} diff --git a/contests/Round#788/E/E.cpp b/contests/Round#788/E/E.cpp deleted file mode 100755 index f7133e4..0000000 --- a/contests/Round#788/E/E.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std - -int main () { - -} diff --git a/contests/Round#788/F/F.cpp b/contests/Round#788/F/F.cpp deleted file mode 100755 index f7133e4..0000000 --- a/contests/Round#788/F/F.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std - -int main () { - -} |
