1 条题解
-
2
#include<bits/stdc++.h> using namespace std; //输入保证正确 //输出看仔细 //所有情况都测 //数组定义,保证正确 int n , a[55] , b[55]; bool check(int x) { while( x != 0) { int t = x%10; bool f = 0; for(int i = 1;i <= n ; i ++) { if(t == a[i] ) f = 1 ; } if(!f) return 0; x /= 10; } return 1; } int main() { cin>> n; for(int i = 1; i <= n; i ++) { cin >>a[i]; b[a[i]] = 1; } int sum = 0 ; for(int i = 100;i < 1000; i ++) { for(int j = 10;j < 100; j ++) { if(check(i)==false||check(j)==false) continue; int t = i * j; if(t > 9999) continue; if(check(t)==false) continue; t = (j % 10 ) * i ; if( t > 999 ) continue; if(check(t)==false) continue; t = (j /10 % 10 ) * i ; if( t > 999 ) continue; if(check(t)==false) continue; sum ++ ; } } cout<< sum ; return 0; }
- 1
信息
- ID
- 232
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 2
- 标签
- 递交数
- 18
- 已通过
- 17
- 上传者