用户输出
328
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#25336 | #1140. ddd和骡马 | Wrong Answer | 10 | 45 ms | 652 K | C++ / 783 B | hujilin | 2020-04-26 11:15:06 |
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 100000;
int a[maxn];
int jiecheng(long long x) {
if (x == 0)
return 1;
return x * jiecheng(x - 1);
}
void calculate(int x) {
int a1 = x / 100000;
int a2 = (x % 100000) / 10000;
int a3 = (x % 10000) / 1000;
int a4 = (x % 1000) / 100;
int a5 = (x % 100) / 10;
int a6 = x % 10;
a[x] = (a1 + a2 + a3 + a4 + a5 + a6);
}
int main() {
long long n;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
calculate(i);
}
long long sum = 0;
for (int i = 1; i <= 45; i++) {
long long k = 0;
for (int j = 1; j <= n; j++) {
if (a[j] == i)
k++;
}
// cout<<k<<endl;
if (jiecheng(k) > 1)
sum += k * (k - 1);
// cout<<sum<<endl;
}
sum += n;
cout << sum;
return 0;
}
用户输出
1384
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
4121
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
6510
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
13663
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
22835
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
34707
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
51604
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
73299
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0