#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
bool t[70000000];
int s[4];
int main()
{
int n,u,i,x,y,tem,ans;
char r[5];
while(scanf("%d",&n)!=EOF)
{
for(i=11111111; i<=66666666; i++)
t[i]=0;
for(u=1; u<=n; u++)
{
scanf("%d%d",&x,&y);
if(u!=n) scanf("%s",r);
s[0]=x;
s[1]=x%10*10+y%10;
s[2]=y%10*10+y/10;
s[3]=y/10*10+x/10;
sort(s,s+4);
tem=s[0]*1000000+s[1]*10000+s[2]*100+s[3];
t[tem]=1;
}
ans=0;
for(i=11111111; i<=66666666; i++)
if(t[i]) ans++;
printf("%d\n",ans);
}
return 0;
}
Codeforces 51A Cheaterius's Problem
最新推荐文章于 2022-10-06 17:32:59 发布