- 博客(10)
- 收藏
- 关注
转载 [hackerrank] Sherlock and Squares
https://www.hackerrank.com/challenges/sherlock-and-squares 这个题就是求两个数字之间的平方数,比如3到9之间,有4和9两个平方数 最初我选择的是简单粗暴的数列方法,然后总是报错(没找到什么特别好的解决方法,就看了一下讨论区推荐找...
2015-06-16 23:15:00 115
转载 ACM ICPC Team
https://www.hackerrank.com/challenges/acm-icpc-team get到了新用法itertools的一点点知识 另外复习了二进制的一些利用(好吧,其实已经忘光了,如果不用二进制来解题,系统总是会判断超时 importitertools peopl...
2015-06-16 20:31:00 157
转载 在线笔试的一道题
#include<iostream> #include<string> #include<set> usingnamespacestd; intmain() { stringquery; cin>>query; ...
2014-08-29 22:05:00 188
转载 CS106B-Section Handout #3(7)
这个题没弄太明白想到的思路,所以MARK下 Problem 7: Old-Fashioned MeasuringIn Dickens’s time, merchants measured many commodities using weights and a two-pan balance...
2014-08-10 11:09:00 213
转载 CS106B-Section Handout #3(3)
第三题把时间主要花费在set的STL和怎么比较struct了怎么搞的上面了……忽然觉得有些不值得 不得不说做公开课作业有一个好处就是很锻炼英文阅读啊,嘤嘤经常晕晕的不知道你想让我做什么泥煤的TvT Problem 3: Cartesian Products 这里set的STL的用法参考了...
2014-07-31 21:31:00 149
转载 CS106B-07课上(按照课上来的)
版本一大概是按照课上来的,版本二是添加了一个处理同时出现多个最大的情况 版本一: #include<iostream> #include<fstream> #include<string> #include<map>...
2014-07-30 20:14:00 124
转载 CS106B-07课上-看字典哪些相同字母组成的单词最多
举例,cheap和peach是用相同字母组成的 相同字母用不同顺序组成不同单词,看看哪些字母组合是出现最多的 =,=, 有结果版是有了最终的结果,方法一和方法二只是构建这个map的嵌套。 方式二是把map<int , map<string ,int> >从main...
2014-07-30 20:13:00 261
转载 CS106B-Section Handout #2(4)
Problem 4: Map Warm-upWrite a function:char MostFrequentCharacter(ifstream &if, int &numOccurrences); that given an input file stream, ret...
2014-07-30 20:12:00 119
转载 C++标准库map的使用
头文件 #include <map> 定义 map<int, string>myMap; 前为key,后为value 插入元素: 1、myMap[1] = "One"; 2、myMap.insert(map<int, string...
2014-07-30 20:10:00 289
转载 CS106B-Section Handout #1(1-3)
Problem 1: Removing all occurrences of characters #include<iostream> #include<string> usingnamespacestd; strin...
2014-07-30 20:08:00 154
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人