| 记录编号 |
607751 |
评测结果 |
AAAAAAAAAA |
| 题目名称 |
3931.[CSP 2023S]密码锁 |
最终得分 |
100 |
| 用户昵称 |
Klee |
是否通过 |
通过 |
| 代码语言 |
C++ |
运行时间 |
0.038 s |
| 提交时间 |
2025-10-20 10:05:52 |
内存使用 |
3.99 MiB |
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
int n;
int a[15][15][15][15][15];
int main ()
{
cin>>n;
for(int i=1;i<=n;i++)
{
int b,c,d,e,f;
cin>>b>>c>>d>>e>>f;
for(int j=0;j<=9;j++)
{
a[(b+j)%10][c][d][e][f]++;
a[b][(c+j)%10][d][e][f]++;
a[b][c][(d+j)%10][e][f]++;
a[b][c][d][(e+j)%10][f]++;
a[b][c][d][e][(f+j)%10]++;
a[(b+j)%10][(c+j)%10][d][e][f]++;
a[b][(c+j)%10][(d+j)%10][e][f]++;
a[b][c][(d+j)%10][(e+j)%10][f]++;
a[b][c][d][(e+j)%10][(f+j)%10]++;
}
}
int ans=0;
for(int i=0;i<=9;i++)
for(int j=0;j<=9;j++)
for(int k=0;k<=9;k++)
for(int m=0;m<=9;m++)
for(int q=0;q<=9;q++)
if(a[i][j][k][m][q]==n) ans++;
cout<<ans<<endl;
return 0;
}