Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
其实有公式可推#include<iostream> using namespace std; int main() { int n,i,count; cin>>n; for(i=2,count=0;n/i-(i-1)/2>0;i++) { if(i%2==0) { if((n/i+n/i+1)*i/2==n) count++; } else { if(n%i==0) count++; } } cout<<count+1<<endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator