Advertisement
adibahbab4108

ADIB

Oct 12th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #define ll long long int
  3. int main()
  4. {
  5.     ll t;
  6.     scanf("%d",&t);
  7.  
  8.     for(int i=1; i<=t; i++)
  9.     {
  10.         ll n;
  11.         scanf("%d",&n);
  12.  
  13.         ll s[n];
  14.         for(int j=0; j<n; j++)
  15.         {
  16.             scanf("%d",&s[j]);
  17.         }
  18.  
  19.         ll high=0,low=0;
  20.         for(int j=0; j<n-1; j++)
  21.         {
  22.             if(s[j]<s[j+1])
  23.                 high++;
  24.             else if(s[j]>s[j+1])
  25.                 low++;
  26.             else continue;
  27.         }
  28.         printf("Case %d : %d %d\n",i,high,low);
  29.     }
  30.     return 0;
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement