-
Notifications
You must be signed in to change notification settings - Fork 0
/
dump.cpp
51 lines (48 loc) · 808 Bytes
/
dump.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// https://codeforces.com/problemset/problem/1840/A
#include<bits/stdc++.h>
using namespace std;
#define LANCER ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define ull unsigned long long
#define nl "\n"
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back
#define no cout<<"NO"<<nl
#define yes cout<<"YES"<<nl
void solve()
{
int n;
string s;
cin>>n>>s;
string ans = "";
for(int i=0;i<n;i++)
{
char c = s[i];
int skip=0;
for(int j=i+1;j<n;j++)
{
skip++;
if(s[j] == c)
{
ans += c;
i += skip;
break;
}
}
}
cout<<ans<<nl;
}
int main()
{
// Faster Input Output
LANCER
int q = 1; cin>>q;
for (int i=1;i<=q;i++)
{
// cout<<"Case "<<i<<": ";
solve();
}
return 0;
}