ZOJ2421 Recaman's Sequence
来源:互联网 发布:淘宝详情推荐宝贝代码 编辑:程序博客网 时间:2024/05/21 09:18
ZOJ的水题怎么老是那么奇葩~~今天真是好好见识了ZOJ的编译器的各种奇葩~~头文件加多了竟然会RE~~囧。。以往我都是头文件一坨坨的堆的~~~
简单打表:
AC program:#include<iostream>using namespace std;int pp[500100];int ff[10000100];// int main(){pp[0]=0;ff[0]=1;int tmp;for(int i=1;i<=500005;i++){ tmp=pp[i-1]-i; if( !ff[tmp]&&tmp>0) { pp[i]=pp[i-1]-i; ff[pp[i]]=1; } else { pp[i]=pp[i-1]+i ;ff[pp[i]]=1;} }int n;while(cin>>n,n!=-1){ cout<<pp[n]<<endl; }//system("pause"); return 0;}
RE program:#include<iostream>#include<stdio.h>#include<string.h>#include<algorithm>#include<math.h>#include<iomanip>#include<queue>#include<map>using namespace std;int pp[500100];int ff[10000100];// int main(){pp[0]=0;ff[0]=1;int tmp;for(int i=1;i<=500005;i++){ tmp=pp[i-1]-i; if( !ff[tmp]&&tmp>0) { pp[i]=pp[i-1]-i; ff[pp[i]]=1; } else { pp[i]=pp[i-1]+i ;ff[pp[i]]=1;} }int n;while(cin>>n,n!=-1){ cout<<pp[n]<<endl; }system("pause"); return 0;}
- ZOJ2421 Recaman's Sequence
- Recaman's Sequence
- PKUOJ2081 Recaman's Sequence
- POJ2081:Recaman's Sequence
- poj2081 Recaman's Sequence
- POJ2081 Recaman's Sequence
- poj2081 Recaman's Sequence
- Recaman's Sequence
- Recaman's Sequence
- WOJ1265-Recaman's Sequence
- zoj 2421 Recaman's Sequence
- POJ 2081 Recaman's Sequence
- poj 2081 Recaman's Sequence
- POJ 2081 Recaman's Sequence
- poj 2081 :Recaman's Sequence
- smoj—Recaman's Sequence
- poj 2081Recaman's Sequence
- zoj 2421 Recaman's Sequence
- 怎样在WebDriver里判断WebElement元素对象是否存在
- web测试需要掌握的知识
- AspNetPager怎么用
- 关于self.用法的一些总结
- log4j控制台日志信息,根据不同级别,以颜色显示
- ZOJ2421 Recaman's Sequence
- 几种流行的AJAX框架jQuery,Mootools,Dojo,Ext JS的对比
- 家乡的小河
- 差异表达分析软件GFOLD安装以及GSL安装问题
- 从svn客户观删除svn服务器的错误目录的方法
- CComPtr用法(转)
- syslog.h源码分析
- ogre 材质学习
- 土坷垃的情怀