摘要: 题目链接:http://poj.org/problem?id=1006我很神经地用了一个&和一个|,跑的结果是wrong answer,我以为是因为我的输出结果不对,可能需要全部一起输出,于是就改用了result[100]这个数组来保存结果,结果变成了runtime error,一直以为测试数据只是用sample input的,在本地跑也没任何问题,就不解了,后来同学一看,发现了&和|的问题,就改了再提交,还是runtime error,后来才知道,噢,100不够,测试数据不止止是sample的数据,就再改,依旧是wrong answer,然后一组特殊的测试值 24 29 34 阅读全文
posted @ 2013-07-30 11:27 OT元旦 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1005Source CodeProblem: 1005User: yuanting0505Memory: 252KTime: 0MSLanguage: C++Result: AcceptedSource Code#include #include using namespace std;int main(int argc, const char * argv[]){ int account; cin>>account; float a,b; int year; for(int i=0;i>a>>b;. 阅读全文
posted @ 2013-07-30 11:19 OT元旦 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 还是很兴奋地用了map.....题目链接:http://poj.org/problem?id=1004Source CodeProblem: 1004User: yuanting0505Memory: 252KTime: 16MSLanguage: C++Result: AcceptedSource Code#include #include using namespace std;int main(int argc, const char * argv[]){ float accout[12]; float sum=0; int i=0; while(i>accout... 阅读全文
posted @ 2013-07-30 11:18 OT元旦 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1003Source CodeProblem: 1003User: yuanting0505Memory: 256KTime: 0MSLanguage: C++Result: AcceptedSource Code#include #include #include using namespace std;int main(int argc, const char * argv[]){ map result; map::iterator iter; float num; int i=0; cin>>nu... 阅读全文
posted @ 2013-07-30 11:14 OT元旦 阅读(291) 评论(0) 推荐(0) 编辑
摘要: 这道题开始用链表来做,遍历之后有序插入,经常new对象,而且一开始next指针没有设置为null导致了一直runtime error,后来发现这个问题后,就很悲催的Time Limit Exceeded,可能是遍历链表的缘故。后来猛然发现map这个好东西,会自动按照key的字典序排序,直接输出就好,实在是好东西啊!但是用g++提交还是超时,用c++确是不超的,原因不知道。。。题目链接:http://poj.org/problem?id=1002Source CodeProblem: 1002User: yuanting0505Memory: 5200KTime: 1141MSLanguage: 阅读全文
posted @ 2013-07-30 11:12 OT元旦 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://poj.org/problem?id=1001Source CodeProblem: 1001User: yuanting0505Memory: 256KTime: 0MSLanguage: C++Result: AcceptedSource Code#include #include #include using namespace std;classbig_float{private: int num[200];//6^25 最多150位 int pos;//pos为小数点位置 int length;//长度public: // big_flo... 阅读全文
posted @ 2013-07-30 11:07 OT元旦 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 第一次做acm的题,不知道原来输入输出完全需要按照它的要求,所以一开始弄了很多乱七八糟的提示,输出也很花哨,提交了好多次。。。#include using namespace std;int main(int argc, const char * argv[]){ int a,b; cin>>a; cin>>b; cout<<a+b<<endl;} 阅读全文
posted @ 2013-07-30 11:03 OT元旦 阅读(137) 评论(0) 推荐(0) 编辑