Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define N int(1e6+6)
- int arr[N+1];
- int main()
- {
- #ifdef HOME
- clock_t Start=clock();
- freopen("data1.in", "r", stdin);
- freopen("data1.out", "w", stdout);
- #endif
- int t, ca=1;
- scanf("%d", &t);
- while(t--) {
- for (int i=0; i<=N; i++)
- arr[i]=0;
- int n;
- scanf("%d", &n);
- int a[n];
- for (int i=0; i<n; i++) {
- scanf("%d", &a[i]);
- arr[a[i]]+=1;
- }
- printf("Case %d:\n", ca++);
- for (int i=0; i<=N; i++) {
- if (arr[i]!=0)
- printf("%d %d\n", i, arr[i]);
- }
- }
- #ifdef HOME
- printf("\n>>Runtime: %.10fs\n", (double) (clock() - Start) / CLOCKS_PER_SEC);
- #endif
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement