随笔分类 -  紫书第五章习题

摘要:水题。/*Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ...shows the fir... 阅读全文
posted @ 2018-04-11 20:48 MCQ 阅读(89) 评论(0) 推荐(0)
摘要:栈的应用,注意q2[i]全部出列后q也要pop。/*InputThe input file will contain one or more test cases. Each test case begins with the number of teamst (1 ... 阅读全文
posted @ 2018-04-11 20:35 MCQ 阅读(127) 评论(0) 推荐(0)
摘要:STL综合运用(set_union和set_intersection)/*InputAn integer 0 ≤ T ≤ 5 on the first line gives the cardinality of the set of test cases. The f... 阅读全文
posted @ 2018-04-11 19:48 MCQ 阅读(116) 评论(0) 推荐(0)
摘要:map的用法#include#include#include#include#include#includeusing namespace std;mapcnt;vector words;string repr(const string &s){ string ... 阅读全文
posted @ 2018-04-11 19:22 MCQ 阅读(84) 评论(0) 推荐(0)
摘要:set的用法#include#include#include#includeusing namespace std;setdict;int main(){ string s,buf; while(cin>>s) { for(int i=0;i>buf) { d... 阅读全文
posted @ 2018-04-10 20:51 MCQ 阅读(118) 评论(0) 推荐(0)