数据水了
D的数据水了,这能过
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
#define inf 0x3f3f3f3f
#define js ios::sync_with_stdio(false)
#define dr cin.tie(0),cout.tie(0)
const int N = 1e6+10;
int n;
void solve()
{
cin>>n;
bool flag2 = false;
vector<string>v(n);
for(int i = 0;i < n; i++) cin>>v[i];
for(int i = 0;i < N; i++){
bool flag = false;
for(int j = 0;j < n; j++){
if(v[j][i % v[j].size()] == '0'){
flag = true;
break;
}
}
if(!flag){
cout<<i + 1<<endl;
flag2 = 1;
break;
}
}
if(!flag2)
cout<<-1<<endl;
}
int main()
{
js,dr;
int T = 1;
//cin>>T;
while(T--)
{
solve();
}
return 0;
}
查看10道真题和解析