摘要: 题目链接: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) 编辑