From 3a89fc707253f75f46fd5a4822817f1fd5156c40 Mon Sep 17 00:00:00 2001 From: Omar Magdy Date: Mon, 30 May 2022 00:18:17 +0200 Subject: Made that every problem is its own folder to make building the code a smooth operation with a shortcut --- contests/05-05-2022(Div.3)/B/B | Bin 33024 -> 808 bytes contests/05-05-2022(Div.3)/B/B.cpp | 48 ------------------------------------- 2 files changed, 48 deletions(-) mode change 100755 => 100644 contests/05-05-2022(Div.3)/B/B delete mode 100644 contests/05-05-2022(Div.3)/B/B.cpp (limited to 'contests/05-05-2022(Div.3)/B') diff --git a/contests/05-05-2022(Div.3)/B/B b/contests/05-05-2022(Div.3)/B/B old mode 100755 new mode 100644 index af9715e..27c4853 Binary files a/contests/05-05-2022(Div.3)/B/B and b/contests/05-05-2022(Div.3)/B/B differ diff --git a/contests/05-05-2022(Div.3)/B/B.cpp b/contests/05-05-2022(Div.3)/B/B.cpp deleted file mode 100644 index 27c4853..0000000 --- a/contests/05-05-2022(Div.3)/B/B.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include - -using namespace std; - -bool isIncreasing(vector v){ - for(int i = 0; i < v.size() - 1; i++) { - if(v[i] >= v[i+1]) { - return false; - } - } - return true; -} -int getIndex(vector v){ - int index; - for(int i = 0; i < v.size(); i++) { - vector 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 v(n); - for(auto &x : v) { - cin >> x; - } - int idx = getIndex(v); - vector 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]; - } - } - } - -} -- cgit v1.2.3