Topic Meaning:
http://acm.hdu.edu.cn/showproblem.php?pid=2601
Give a number n, ask N=i*j+i+j altogether how many kinds of scheme.
Topic Analysis:
The direct violent simulation of this problem, just need to convert the n+1= (i+1) * (j+1) to calculate.
AC Code:
/** *hdu2601 an easy problem * meaning: To find the type of N=I*J+I+J * Analysis: Convert to N+1= (i+1) * (j+1), solve on the line * * #include <iostream> #include < cstdio> #include <map> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <vector> #include <stack> #include <cstdlib> #include <cctype> #include <cstring> #include <cmath>using namespace Std;int main () { int t;long long n; cin>>t; while (t--) { cin>>n; n=n+1; int k=0; For (long long i=2;i*i<=n;i++) { if (n%i==0) k++; } cout<<k<<endl; } return 0;}
hdu2601 an easy problem (mathematics)