Submission #3007329
Source Code Expand
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<n; i++) #define rep_r(i,n,m) for(int i=m; i<n; i++) #define MAX 100 ll N; ll divs = 0; vector<int> v; void gen_primes() { v.push_back(2),v.push_back(3); for (int i = 4; i < 1000; ++i) { bool flag = true; for (int j = 2; j < i; ++j) { if (i % j == 0) { flag = false; break; } } if (flag) v.push_back(i); } } int main() { cin >> N; gen_primes(); vector<int> d; for (auto itr = v.begin(); itr != v.end(); itr++) { int t = *itr; int tt = 0; while (t <= N) { tt += N / t; t *= *itr; } if (tt != 0){ d.push_back(++tt); } } ll ans = 1; const long MOD = 1000000007; for (auto itr = d.begin(); itr != d.end(); ++itr) { cout << *itr << " "; } puts(""); for (auto itr = d.begin(); itr != d.end(); ++itr) { ans *= *itr; ans %= MOD; } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Factors of Factorial |
User | seriru |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1262 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | WA | 1 ms | 256 KB |
sample_02.txt | WA | 1 ms | 256 KB |
sample_03.txt | WA | 1 ms | 256 KB |
subtask_1_certain_01.txt | AC | 1 ms | 256 KB |
subtask_1_certain_02.txt | WA | 1 ms | 256 KB |
subtask_1_certain_03.txt | WA | 1 ms | 256 KB |
subtask_1_certain_04.txt | WA | 1 ms | 256 KB |
subtask_1_rand_01.txt | WA | 1 ms | 256 KB |
subtask_1_rand_02.txt | WA | 1 ms | 256 KB |
subtask_1_rand_03.txt | WA | 1 ms | 256 KB |