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 |
请教大牛,为什么我这个算法是WA呢!!!!!!!!!!#include<iostream> using namespace std; int main() { int num; int cnt = 0; cin >> num; num *= 2; int tmp = num; for(int i=1;i<=num;i++) { num = tmp; if(num%i==0) { num /=i; num = num + 1 - i; if(num>0 && num%2==0) cnt++; } } cout<<cnt<<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