Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我的分析

Posted by 20053565 at 2011-05-31 15:04:05 on Problem 1000
In Reply To:Re:关键不是输出结果,是运行过程,他竟然没有RE,没有TLE,也没有MLE~递归需要栈空间啊 Posted by:Moon_1st at 2011-05-31 13:55:39
#include <iostream>
#include <cstdio>
using namespace std;

typedef long long llg;

llg a, b;

llg f(llg a, llg b, int depth)
{
    llg i, j, k, l, v, m, ks;//这些变量编译的时候就被优化掉了吧
    if(depth == 100000000)  return  a+b;
    else  return  f(a, b, depth+1);//这个不能算作递归的,我做过实验
}

int main()
{
    while(cin>>a>>b)  cout<<f(a, b, 0)<<endl;
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator