Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int dt, a[20], ans;
- int main () {
- int tc, i, j, k;
- cin>>tc;
- while (tc--) {
- cin>>dt;
- for (i=0; i<15; i++) cin>>a[i];
- ans = 0;
- for (i=1; i<14; i++) for (j=i; j<14; j++) {
- bool isl = true;
- for (k=i; k<=j; k++) if (a[k] <= a[i-1] || a[k] <= a[j+1]) isl = false;
- if (isl) ans++;
- }
- cout<<dt<<" "<<ans<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement