diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-11-05 01:41:11 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-11-05 01:41:11 +0200 |
| commit | 7f856c7ff080b8d455b9ed16c2e57dd862c3879d (patch) | |
| tree | c2baf90f98c91567358003d6b97a4afed7fa9b42 /iceCreamParlor/iceCreamParlor.cpp | |
| parent | c52b36c6a37fdb1d1de146d3939cb42e2c691f44 (diff) | |
| download | competitive-programming-7f856c7ff080b8d455b9ed16c2e57dd862c3879d.tar.xz competitive-programming-7f856c7ff080b8d455b9ed16c2e57dd862c3879d.zip | |
moved some file
Diffstat (limited to 'iceCreamParlor/iceCreamParlor.cpp')
| -rw-r--r-- | iceCreamParlor/iceCreamParlor.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/iceCreamParlor/iceCreamParlor.cpp b/iceCreamParlor/iceCreamParlor.cpp deleted file mode 100644 index eb29391..0000000 --- a/iceCreamParlor/iceCreamParlor.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std; - -bool cleanVec(vector<int> v){ - sort(v.begin(), v.end()); - for(int i = 0; i < v.size() - 1; i++) { - if(v[i] == v[i + 1]) { - return true; - } - } - return false; -} - -int main() { - int t,m,n; - cin >> t; - while(t--) { - cin >> m; - cin >> n; - vector<int> v(n); - for(int &x : v) { - cin >> x; - } - for(int i = 1; i <= n; i++) { - auto it = find(v.begin() + i, v.end(), m - v[i - 1]); - if(it != v.end() && cleanVec(v)) { - cout << v.end() - it - i - 1 << " " << it - v.begin() + i << '\n'; - break; - } - else { - cout << v.end() - it - i << " " << it - v.begin() + i << '\n'; - break; - } - } - } - return 0; -} |
