-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCARVANS.c
More file actions
37 lines (37 loc) · 679 Bytes
/
CARVANS.c
File metadata and controls
37 lines (37 loc) · 679 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<stdio.h>
#define gc getchar
inline long long int scan() {
char c = gc();
while(c<'0' || c>'9') c = gc();
long long int ret = 0;
while(c>='0' && c<='9') {
ret = 10 * ret + c - 48;
c = gc();
}
return ret;
}
int main()
{
long long int t,n,i,count;
t=scan();
while(t--)
{
count=1;
n=scan();
long long int A[n];
for(i=0;i<n;i++)
{
A[i]=scan();
if(i>0)
{
if(A[i]>A[i-1])
{
A[i]=A[i-1];
}
else count++;
}
}
printf("%lld\n",count);
}
return 0;
}