Contest Duration: - (local time) (100 minutes) Back to Home

Submission #3705642

Source Code Expand

Copy
```#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>

using namespace std;

// 75 = 3 * 5^2
int main() {

int n;
cin >> n;

const vector<int> p = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
const int pn = p.size();
vector<int> f(p.size(), 0);

// factorize N!
for (int i = 1; i <= n; i++) {
int m = i;
if (m == 1) continue;
for (int j = 0; j < pn; j++) {
while (m % p[j] == 0) {
m /= p[j];
f[j]++;
}
}
}

// count them out

int ans = 0;

// (2, 4, 4)
int over4 = 0;
for (int i = 0; i < pn; i++)
if (f[i] >= 4) over4++;
for (int i = 0; i < pn; i++) {
if (f[i] < 2) continue;
int cand = f[i] >= 4 ? over4 - 1 : over4;
ans += cand * (cand - 1) / 2;
}

// (4, 14)
int over14 = 0;
for (int i = 0; i < pn; i++)
if (f[i] >= 14) over14++;
ans += over14 * (over4 - 1);

// (2, 24)
int over2 = 0, over24 = 0;
for (int i = 0; i < pn; i++) {
if (f[i] >=  2) over2++;
if (f[i] >= 24) over24++;
}
ans += over24 * (over2 - 1);

// (74)
if (f[0] >= 74) ans++;

cout << ans << endl;

}```

#### Submission Info

Submission Time 2018-12-02 21:53:47+0900 D - 756 ganmodokix C++14 (GCC 5.4.1) 400 1577 Byte AC 1 ms 256 KB

#### Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
 AC × 3
 AC × 20
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 AC 1 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 1 ms 256 KB
b06 AC 1 ms 256 KB
b07 AC 1 ms 256 KB
b08 AC 1 ms 256 KB
b09 AC 1 ms 256 KB
b10 AC 1 ms 256 KB
b11 AC 1 ms 256 KB
b12 AC 1 ms 256 KB
b13 AC 1 ms 256 KB
b14 AC 1 ms 256 KB
b15 AC 1 ms 256 KB
b16 AC 1 ms 256 KB
b17 AC 1 ms 256 KB
b18 AC 1 ms 256 KB
b19 AC 1 ms 256 KB
b20 AC 1 ms 256 KB