We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ede85a4 commit da94dafCopy full SHA for da94daf
Codeshef/CHEGLOVE.cpp
@@ -0,0 +1,27 @@
1
+#include <bits/stdc++.h>
2
+using namespace std;
3
+
4
+int main() {
5
+ int T;
6
+ cin>>T;
7
+ while(T--){
8
+ int n,frnt=0,back=0;
9
+ cin>>n;
10
+ int flen[n],glen[n];
11
+ for(int i=0;i<n;i++){
12
+ cin>>flen[i];
13
+ }
14
15
+ cin>>glen[i];
16
17
18
+ if(flen[i]<=glen[i])frnt++;
19
+ if(flen[i]<=glen[n-i-1])back++;
20
21
+ if(frnt==n && back==n)cout<<"both"<<endl;
22
+ else if (frnt==n) cout<<"front"<<endl;
23
+ else if(back==n)cout<<"back"<<endl;
24
+ else cout<<"none"<<endl;
25
26
+ return 0;
27
+}
0 commit comments