上一页 1 ··· 14 15 16 17 18
摘要: 水题。/*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) 编辑
摘要: 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 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 模拟的一个水题,然而我花了两天,各种WA,最终借鉴了大神的思路和代码AC了。/*The input of your program is a textfile that ends with the standard end-of-file marker. Each l... 阅读全文
posted @ 2018-04-10 20:37 MCQ 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 此题如题号213。。注意输入就行了。#include#includeusing namespace std;int code[8][1<<8];int readchar(){ for(;;) { int ch=getchar(); if(ch!='\n'&&ch!... 阅读全文
posted @ 2018-04-08 13:31 MCQ 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 循环模拟的水题,类似约瑟夫环,主要难点是判断到达界限然后取模。题目很坑,注意开始p1=n-1,p2=0,当停到某个下标时应从 下一个下表数起我的思路如下#includeusing namespace std;int n,k,m,a[25];int go(int p,i... 阅读全文
posted @ 2018-04-07 02:16 MCQ 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 第一篇博客,虽然是个水题,但对我这种小白还是挺艰难的。思路难点是对已经查过的字符的标记。此题要注意:猜已经猜过的字母也算错题目:https://vjudge.net/problem/UVA-489AC代码:#include#includeusing namespace... 阅读全文
posted @ 2018-04-07 00:14 MCQ 阅读(104) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18