#include<bits/stdc++.h>
using namespace std;
#define x first
#define y second
typedef pair<int,int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef vector<string> VS;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
vector<int> vx;
inline int mp(int x) {return upper_bound(vx.begin(),vx.end(),x)-vx.begin();}
inline int log_2(int x) {return 31-__builtin_clz(x);}
inline int popcount(int x) {return __builtin_popcount(x);}
inline int lowbit(int x) {return x&-x;}
void solve()
{
int n;
cin>>n;
vector<array<int,6>> a(n);
set<array<int,6>> s;
for(int i=0;i<n;++i)
{
for(int j=0;j<6;++j)
cin>>a[i][j];
for(int j=0;j<6;++j)
{
array<int,6> t1,t2;
//t1顺时针,t2逆时针
for(int k=0;k<6;++k)
{
t1[k] = a[i][(j+k)%6];
t2[k] = a[i][(j-k+6)%6];
}
if(s.find(t1)!=s.end()||s.find(t2)!=s.end())
{
cout<<"Twin snowflakes found.\n";
return ;
}
}
s.insert(a[i]);
}
cout<<"No two snowflakes are alike.\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int T = 1;
//cin>>T;
while(T--)
{
solve();
}
}
标签:P10467,Hash,Snowflakes,int,typedef,long,vector,vx,return
From: https://www.cnblogs.com/ruoye123456/p/18412829