打不了表,终端只显示前9000多条结果,答案有2e5的数量级,而且acwing复制到27000条结果时调试就已经会报错,9000条的结果提交会显示upload failed,调试的话可过样例
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef pair<string,int> PSI;
const int N=5e6+10;
// struct PW
// {
// string g;int id;
// }temp;
// vector<PW> v;
// PII a[N];int cnt;
// int dx[5]={-1,0,1,0,0},dy[5]={0,1,0,-1,0};
// void work()
// {
// for(int k=1;k<=6;k++)
// {
// int cur=(1<<k)-1,limit=1<<25;
// while(cur<limit)
// {
// a[cnt++]={cur,k};
// int lb=cur&-cur;
// int r=lb+cur;
// cur=((r^cur)>>__builtin_ctz(lb)+2)|r;
// }
// }
// for(int i=0;i<cnt;i++)
// {
// temp.g="1111111111111111111111111";
// int t=a[i].x,u=a[i].y;
// for(int j=0;j<5;j++)
// for(int k=0;k<5;k++)
// if(t>>(j*5+k)&1)
// {
// for(int q=0;q<5;q++)
// {
// int u=j+dx[q],w=k+dy[q];
// if(u<0||u>=5||w<0||w>=5)continue;
// temp.g[u*5+w]^=1;
// }
// }
// temp.id=u;
// v.push_back(temp);
// }
// cout<<v.size();
// for (int i = 0; i < v.size(); i++) {
// printf("{\"");
// cout << v[i].g;
// printf("\",%d}", v[i].id);
// if (i != v.size() - 1)
// printf(",\n");
// }
// }
PSI v[N]={
};
void work()
{
string s;
int t=5;
while(t--)
{
string x;cin>>x;
s+=x;
}
for(int i=0;i<245505;i++)if(s==v[i].x)cout<<v[i].y;
}
int main()
{
int T=1;
cin>>T;
while(T--)work();
return 0;
}