AtCoder Beginner Contest 052

Submission #1585103

Source codeソースコード

#include <bits/stdc++.h>
#include <regex>
using namespace std;
typedef long long ll;

#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define SIZE(array) (sizeof(array) / sizeof(array[0]))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define MAX_V 100000

#define MOD 1000000007L
#define INF 100000000000

signed main() {
	int n;
	cin >> n;
	vector<int> v(n + 1);
	for (size_t i = 2; i <= n; i++) {
		int t = i;
		for (size_t j = 2; j <= i; j++) {
			while (t % j == 0) {
				v[j]++;
				t /= j;
			}
		}
	}
	long sum = 1;
	for (size_t i = 2; i <= n; i++) {
		// cout << v[i] << ", ";
		sum = (sum * (v[i] + 1)) % MOD;
	}
	cout << sum << endl;
}

Submission

Task問題 C - Factors of Factorial
User nameユーザ名 えるざっぷ
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 AC
Score得点 300
Source lengthソースコード長 785 Byte
File nameファイル名
Exec time実行時間 6 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 6 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 6 ms 256 KB
subtask_1_certain_04.txt AC 6 ms 256 KB
subtask_1_rand_01.txt AC 3 ms 256 KB
subtask_1_rand_02.txt AC 3 ms 256 KB
subtask_1_rand_03.txt AC 2 ms 256 KB