
STL
julia7_
keep coding
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
A1039 Course List for Student (25 分)(vector)
Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes ...原创 2019-02-17 22:57:14 · 382 阅读 · 0 评论 -
A1051 Pop Sequence (25 分)(stack)
Given a stack which can keepMnumbers at most. PushNnumbers in the order of 1, 2, 3, ...,Nand pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of t...原创 2019-02-20 20:11:34 · 194 阅读 · 0 评论 -
A1022 Digital Library (30 分)(map + set)
A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number a...原创 2019-03-08 22:55:50 · 141 阅读 · 0 评论 -
A1071 Speech Patterns (25 分)(找出一句话中单词出现次数最多的那个)(map)
People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down a speaker...原创 2019-02-20 16:35:04 · 289 阅读 · 0 评论 -
B1044 火星数字 (20 分)(map)
火星人是以 13 进制计数的: 地球人的 0 被火星人称为 tret。 地球人数字 1 到 12 的火星文分别为:jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec。 火星人将进位以后的 12 个高位数字分别称为:tam, hel, maa, huh, tou, kes, hei, elo, syy, lok, mer, jo...原创 2019-02-19 11:35:39 · 328 阅读 · 0 评论 -
A1060 Are They Equal (25 分)(科学表示法时是否相同)(string)(难)
If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as0.123×10^5with simple chopping. Now given the number of signi...原创 2019-02-04 17:28:43 · 302 阅读 · 0 评论 -
1063 Set Similarity (25 分)(set)
Given two sets of integers, the similarity of the sets is defined to beNc/Nt×100%, whereNcis the number of distinct common numbers shared by the two sets, andNtis the total number of ...原创 2019-02-18 13:11:55 · 205 阅读 · 0 评论 -
STL 问题归纳
Vector: 特点:变长数组,一般在元素个数不确定的情况下使用 添加头文件 #include <vector>, 以及 using namespace std; 定义:vector<typename> name; 相当于一位数组 name[SIZE], 只不过其长度可以根据需要进行变化,比较节省空间,“变长数组” vector 数组定义:vector<typ...原创 2019-03-08 20:25:57 · 332 阅读 · 0 评论 -
A1047 Student List for Course (25 分)(vector + char二维数组)
本题为A1039 Course List for Student (25 分)反过来的题 Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the ...原创 2019-02-18 12:07:47 · 168 阅读 · 0 评论 -
A1056 Mice and Rice (25 分)(分组筛选最大进行排序)(queue)(难)
Mice and Riceis the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice...原创 2019-02-21 12:02:17 · 224 阅读 · 0 评论