-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKickstart.cpp
More file actions
37 lines (37 loc) · 827 Bytes
/
Kickstart.cpp
File metadata and controls
37 lines (37 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bits/stdc++.h>
using namespace std;
int main(){
long long int t,x=0,n,count,temp,cur,k,i,j;
cin>>t;
for(i=0;i<t;i++){
cin>>n>>k;
x=0;
long long int a[n],ind[n];
for(j=0;j<n;j++){
cin>>a[j];
if(a[j]==k){
ind[x]=j;
x++;
}
}
long long int xmax=x;
count=0;
for(x=0;x<xmax;x++){
cur=k;
temp=1;
for(j=ind[x];cur>0;j++,cur--){
if(a[j]==cur)
continue;
else
{
temp = 0;
break;
}
}
if(temp==1){
count++;
}
}
cout<<"Case #"<<i+1<<": "<<count<<endl;
}
}