摘要: 水题。/*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 阅读(85) 评论(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 阅读(122) 评论(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 阅读(110) 评论(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 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 在g++中是不能使用itoa()的,即没有库函数实现数字向字符串的转化(至少我还不知道有这种库函数). 有时候需要数字字符串之间相互转化的时候,就比较郁闷了(我编程水平不高,又懒得写). 偶然一天发现stringstream可以方便的实现数字与字符串之间的转化,拿来跟... 阅读全文
posted @ 2018-04-11 06:47 MCQ 阅读(788) 评论(0) 推荐(0) 编辑