Created
March 5, 2015 07:01
-
-
Save shohan4556/a8c6b8ca3e0724d60632 to your computer and use it in GitHub Desktop.
URI 1609 solution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// URI : 1609 | |
| /// Author : Shohanur Rahaman | |
| #include<stdio.h> | |
| #include<stdlib.h> | |
| #include<string.h> | |
| int ara[10000]; | |
| int main() | |
| { | |
| memset(ara,0,sizeof ara); | |
| int tc,n,i,j,tmp; | |
| scanf("%d",&tc); | |
| while(tc--){ | |
| int tmp=0; | |
| scanf("%d",&n); | |
| for(i=0;i<n;i++){ | |
| scanf("%d",&ara[i]); // 1 2 3 2 3 -- output--: 3 | |
| tmp++; | |
| } | |
| int t=0; | |
| for(i=0;i<n;i++){ | |
| t=ara[i]; // 1 | |
| for(j=i+1;j<n;j++){ | |
| if(t==ara[j]){ | |
| tmp=tmp-1; | |
| break; | |
| } | |
| } | |
| } | |
| printf("%d\n",tmp); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment