You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.1 KiB

2 years ago
#include <bits/stdc++.h>
using namespace std;
/*
07 ( 0) 46972
: 0-7 1,2,3, 4, 5, 6,7,8,
1 4 1357
2 6*4 =4*6 408-2=66*4=24
3 6*6*4 =4*6*6 26
4 6*6*5*4 =4*6*6*5 35
5 6*6*5*4*4 =4*6*6*5*4 44
6 6*6*5*4*4*3 =4*6*6*5*4*3
7 6*6*5*4*4*3*2 = 4*6*6*5*3*2
86*6*5*4*4*3*2*1 =4*6*6*5*4*3*2*1
*/
int main() {
//加一位和两位的个数
int cnt = 4 + 4 * 6;
int x = 6;
//从3到8
for (int i = 3; i <= 8; i++) {
cnt += 6 * 4 * x;
x = x * (8 - i);
}
printf("%d\n", cnt);
return 0;
}