编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#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;
}
子任务 #1
Wrong Answer
得分:10
测试点 #1
Accepted
得分:100
用时:2 ms
内存:352 KiB

输入文件(1.in

62

答案文件(1.out

328

用户输出

328

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:3 ms
内存:284 KiB

输入文件(2.in

712

答案文件(2.out

30968

用户输出

1384

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:4 ms
内存:372 KiB

输入文件(3.in

2663

答案文件(3.out

403601

用户输出

4121

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #4
Wrong Answer
得分:0
用时:4 ms
内存:408 KiB

输入文件(4.in

6306

答案文件(4.out

2108470

用户输出

6510

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:3 ms
内存:396 KiB

输入文件(5.in

12489

答案文件(5.out

7534405

用户输出

13663

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #6
Wrong Answer
得分:0
用时:4 ms
内存:364 KiB

输入文件(6.in

21533

答案文件(6.out

22208009

用户输出

22835

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #7
Wrong Answer
得分:0
用时:4 ms
内存:484 KiB

输入文件(7.in

34247

答案文件(7.out

56739967

用户输出

34707

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #8
Wrong Answer
得分:0
用时:6 ms
内存:484 KiB

输入文件(8.in

51144

答案文件(8.out

122757374

用户输出

51604

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #9
Wrong Answer
得分:0
用时:8 ms
内存:632 KiB

输入文件(9.in

72839

答案文件(9.out

243907943

用户输出

73299

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #10
Wrong Answer
得分:0
用时:7 ms
内存:652 KiB

输入文件(10.in

99960

答案文件(10.out

432430482

用户输出

101258

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0