Untitled
unknown
plain_text
2 years ago
1.1 kB
8
Indexable
#include <iostream>
using namespace std;
int main(){
freopen("input.txt","r",stdin);
int T;
for (T = 0; T < 10; T++){
int N;
cin >> N;
char A[100];
cin >> A;
int i=0,j;
while (i<N-1){
int check=0;
if (A[i+1]==A[i]){
for (j=i;j<N-2;j++)
A[j]=A[j+2];
A[j+1]='/0';
N-=2;
if (i>0)
i--;
} else {
i++;
}
}
cout<<"#"<<T+1<<" ";
for (i=0;i<N;i++) cout<< A[i];
cout<<endl;
}
return 0;
}
/*
10 1238099084
16 4100112380990844
26 12380990844100112380990844
42 123809908444100112380990844100112380990844
55 1238099084441001123809908441001321238099084432180990844
60 123809908444100145351123809908441001321238099084432180990844
71 12380990844410013218099084441001123809908441001321238099084432180990844
99 123809908444100180990844410013211238099084410013212380990844123809908441238099084410013232180990844
82 1238099084441001410011238099084412380990844100132123809908441238099084432180990844
58 0899809812380990844100132123809908441238099084432180990844
*/Editor is loading...