-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathATTND.cpp
More file actions
35 lines (33 loc) · 706 Bytes
/
ATTND.cpp
File metadata and controls
35 lines (33 loc) · 706 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
// https://www.codechef.com/problems/ATTND
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
int n,sum=0;
cin>>n;
string arr[n];
string ar[n];
for(int j=0;j<n;j++)
cin>>arr[j]>>ar[j];
for(int j=0;j<n;j++)
{
sum=0;
for(int k=0;k<n;k++)
{
if(j!=k)
{
if(arr[j]==arr[k])
sum++;
}
}
if(sum>0)
cout<<arr[j]<<" "<<ar[j]<<endl;
else
cout<<arr[j]<<endl;
}
}
}