AtCoder Beginner Contest 052

Submission #2544413

Source codeソースコード

#include <iostream>
using namespace std;
int n, f[1100];
int main(void){
        // Your code here!
        cin >> n;
        for (int i = 2; i <= n; i++) {
                int ans = 0;
                for (int j = 2; j < i; j++) {
                        if (i % j == 0) ans++;
                }
                if (ans == 0) f[i] = 1;
        }
        long long res = 1;
        for (int i = 1; i <= n; i++) {
                if (f[i] == 1) {
                        int num = i, cou = 1;
                        while (num <= n) {
                                cou += n / num;
                                num *= i;
                        }
                        res = res * cou % 1000000007;
                }
        }
        cout << res << endl;
}

Submission

Task問題 C - Factors of Factorial
User nameユーザ名 Sano98
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 300
Source lengthソースコード長 790 Byte
File nameファイル名
Exec time実行時間 3 ms
Memory usageメモリ使用量 256 KB

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_01.txt,sample_02.txt,sample_03.txt
All 300 / 300 sample_01.txt,sample_02.txt,sample_03.txt,subtask_1_certain_01.txt,subtask_1_certain_02.txt,subtask_1_certain_03.txt,subtask_1_certain_04.txt,subtask_1_rand_01.txt,subtask_1_rand_02.txt,subtask_1_rand_03.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 3 ms 256 KB
subtask_1_certain_01.txt AC 1 ms 256 KB
subtask_1_certain_02.txt AC 1 ms 256 KB
subtask_1_certain_03.txt AC 3 ms 256 KB
subtask_1_certain_04.txt AC 3 ms 256 KB
subtask_1_rand_01.txt AC 2 ms 256 KB
subtask_1_rand_02.txt AC 2 ms 256 KB
subtask_1_rand_03.txt AC 1 ms 256 KB