九度OJ做题记录 更新.....

2015年1月7日 20:34:23

 题目1007:奥运排序问题 有点意思,以后想另外方法快速做出来

2015年1月7日 21:03:56

有一个技巧就是,写了三个比较函数cmp1,cmp2,cmp3,之后用函数指针数组,bool (*cmp[4])(Student &,Student &)={cmp1,cmp1,cmp2,cmp3}
这样,根据实力所给的 C 可以用 cmp[C] 来很方便地传入比较函数,相对模块化一些

2015年1月8日 07:53:31

#ifndef online_judge
freopen("d://code//acm//txt//16.txt","r",stdin);
#endif

使用后会导致超时

cin   cout;时间浪费得多 不如以后都用scanf 和 printf;

2015年1月8日 09:56:23

使用容器容易超时 注意空格的设置哦 1117题

2015年1月8日 10:38:56

北大的机试注意输出格式

看别人的代码确实有好处

istringstream record1(a);

istringstream record2(b); string name1,date1,time1,period1; string name2,date2,time2,period2; record1>>name1>>date1>>time1>>period1; record2>>name2>>date2>>time2>>period2;
这个代码可以用来代替sprintf;呵呵;

2015年1月8日 11:03:12
while (getline(cin,str)&&!str.empty())
1130 很锻炼c++语法知识;很好

原文地址:https://www.cnblogs.com/dragonfive/p/4486209.html