Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int a,b,c,d,e,f,g,h,i,j=1,k=0,x;
- scanf("%d",&a);
- for(b=0;b<a;b++)
- {
- scanf("%d %d",&c,&d);
- int x[c];
- for(e=0;e<d;e++)
- {
- printf("Case %d:\n",++j);
- scanf("%d",&f);
- if(f==1){scanf("%d",&g);x[g]=g;}
- else {
- k=0;
- scanf("%d %d",&h,&i);
- for(h;h<=i;h++)
- {
- if(h==x[h]){k++;}
- }
- printf("%d\n",k);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement