From 7f856c7ff080b8d455b9ed16c2e57dd862c3879d Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Sat, 5 Nov 2022 01:41:11 +0200 Subject: moved some file --- MakeItIncreasing/MakeItIncreasing.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 MakeItIncreasing/MakeItIncreasing.cpp (limited to 'MakeItIncreasing') diff --git a/MakeItIncreasing/MakeItIncreasing.cpp b/MakeItIncreasing/MakeItIncreasing.cpp deleted file mode 100644 index 987ef04..0000000 --- a/MakeItIncreasing/MakeItIncreasing.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -using namespace std; -int main() { - int tt; - cin >> tt; - while(tt--) { - int n; - int ans = 0; - cin >> n; - vector v(n); - for(auto &x : v) cin >> x; - for(int i = n - 1; i > 0; i--) { - while(v[i] <= v[i-1] && v[i - 1] > 0) { - v[i-1] = v[i-1] / 2; - ans++; - } - if(v[i] == v[i-1]) { - ans = -1; - break; - } - } - cout << ans << endl; - } -} -- cgit v1.2.3