You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# include <bits/stdc++.h>
const int N = 110 ;
char a [ N ] [ N ] ;
/*
4
abccddadca
*/
using namespace std ;
struct Node {
int x , y ;
char c ;
} ;
vector < Node > q ;
int main ( ) {
# ifndef ONLINE_JUDGE
freopen ( " ZhiMuSanJiaoXing.in " , " r " , stdin ) ;
# endif
int n ;
cin > > n ;
string s ;
cin > > s ;
// 先把字符串存入char[][]
int idx = 0 ;
for ( int i = 0 ; i < n ; i + + ) // n行
for ( int j = 0 ; j < = i ; j + + ) // i列
a [ i ] [ j ] = s [ idx + + ] ;
// 把所有坐标记录下来
for ( int i = 0 ; i < n ; i + + ) {
for ( int j = 0 ; j < = i ; j + + )
q . push_back ( { i , j , a [ i ] [ j ] } ) ;
}
vector < char > res ;
// 在q数组中, 选择任意三个, 计算两两间距离是不是相等
for ( int i = 0 ; i < q . size ( ) ; i + + )
for ( int j = i + 1 ; j < q . size ( ) ; j + + )
for ( int k = j + 1 ; k < q . size ( ) ; k + + ) {
Node x = q [ i ] , y = q [ j ] , z = q [ k ] ;
if ( check ( ) ) res . push_back ( x . c ) ;
}
if ( res . size ( ) = = 0 )
cout < < " No Solution " < < endl ;
else {
sort ( res . begin ( ) , res . end ( ) ) ;
for ( char x : res ) cout < < x < < endl ;
}
return 0 ;
}