提出 #4400525


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/02/27  Problem: ABC 114 D / Link: http://abc114.contest.atcoder.jp/tasks/abc114_d  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL ans = 0LL;

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(false);

	LL N;
	cin >> N;
	map<int, int>Prime;
	FOR(i, 1, N + 1) {
		LL x = i;
		FOR(d, 2, i + 1) {
			while (x%d == 0) {
				Prime[d]++;
				x /= d;
			}
		}
	}
	VI pidx;
	for (auto it : Prime) {
		pidx.push_back(it.first);
	}
	DD(De(pidx));
	FOR(i, 0, SZ(pidx)) {
		FOR(j, i + 1, SZ(pidx)) {
			FOR(k, 0, SZ(pidx)) { //  5 5 3
				if (k == i || k == j)continue;
				if (Prime[pidx[i]] >= 4 && Prime[pidx[j]] >= 4 && Prime[pidx[k]] >= 2) {
					ans++;
				}
			}
			// 25 3
			if (Prime[pidx[i]] >= 24 && Prime[pidx[j]] >= 2) {
				ans++;
			}
			if (Prime[pidx[i]] >= 2 && Prime[pidx[j]] >= 24) {
				ans++;
			}
			// 15 5
			if (Prime[pidx[i]] >= 14 && Prime[pidx[j]] >= 4) {
				ans++;
			}
			if (Prime[pidx[i]] >= 4 && Prime[pidx[j]] >= 14) {
				ans++;
			}

		}
		// 75
		if (Prime[pidx[i]] >= 74)ans++;
	}


	cout << ans << "\n";

	return 0;
}

提出情報

提出日時
問題 D - 756
ユーザ Yang33
言語 C++14 (GCC 5.4.1)
得点 400
コード長 2175 Byte
結果 AC
実行時間 1 ms
メモリ 256 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 20
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
a01 AC 1 ms 256 KiB
a02 AC 1 ms 256 KiB
a03 AC 1 ms 256 KiB
b04 AC 1 ms 256 KiB
b05 AC 1 ms 256 KiB
b06 AC 1 ms 256 KiB
b07 AC 1 ms 256 KiB
b08 AC 1 ms 256 KiB
b09 AC 1 ms 256 KiB
b10 AC 1 ms 256 KiB
b11 AC 1 ms 256 KiB
b12 AC 1 ms 256 KiB
b13 AC 1 ms 256 KiB
b14 AC 1 ms 256 KiB
b15 AC 1 ms 256 KiB
b16 AC 1 ms 256 KiB
b17 AC 1 ms 256 KiB
b18 AC 1 ms 256 KiB
b19 AC 1 ms 256 KiB
b20 AC 1 ms 256 KiB