CodeForces 577A Multiplication Table 质因子数
题目:click here
题意:看hint就懂了
分析:数论小题,在n0.5时间里求n的质因子数
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n, x; ll ans; void solve() { ans = 0; for( int i=1; i*i<=x; i++ ) { if( i <= n ) { if( x%i == 0 && x/i <= n ) { if( i == x/i ) ans += 1; else ans += 2; } } else break; } printf("%I64d\n", ans ); } int main() { while( ~scanf("%d%d", &n, &x ) ) { solve(); } return 0; }