PAT甲级——A1022 Digital Library】的更多相关文章

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 as its ID. Given any query from a reader, you are s…
https://pintia.cn/problem-sets/994805342720868352/problems/994805480801550336 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 assigne…
1022. Digital Library (30) 时间限制 1000 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Ea…
1022 Digital Library (30 分)   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 as its ID. Given any…
题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805480801550336 题意: 每一本书有一个id, 书名,作者,至多五个关键字,一个出版社名,出版社年份. 现在根据给定的书名或作者或关键字或出版社名或年份,按照id字典序大小输出符合条件的书. 思路: 对每一个属性都用map维护. 一个坑点是,前面说书的年份一定在1000-3000之间,但是查询的时候的年份不一定满足,而且这里输出的时候也要满足4位.测试点…
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 as its ID. Given any query from a reader, you are s…
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 as its ID. Given any query from a reader, you are s…
[题目大意] 给出几本书的信息,包括编号,名字,出版社,作者,出版年份,关键字:然后给出几个请求,分别按照1->名字,2->出版社等对应信息查询符合要求的书的编号. [思路] 模拟. [坑] 1) 根据空格判断关键字key,遇到空格存下前一个key,则到最后一个key没有保存,退出while循环后要再存一次. 2) 漏根据id排序 3) Not Found 拼写错了... 4) 题目说年份在[1000, 3000],但是并不是这样的!输出年份一定要保留4位高位填充0补齐,否则测试点1过不了.这…
https://www.patest.cn/contests/pat-a-practise/1022 直接模拟, 输入,按id排序,检索 #include <iostream> #include <string> #include <algorithm> using namespace std; struct book //图书结构 { string id; string title; string author; int k; //关键词数量 string key[5…
题意 输入n本书的信息:id,书名,作者,关键字,出版社,出版年份.搜索图书,输出id. 思路 定义5个map<string, set<int> >,分别存放Title, Author, Word, Publishier, Year与id的映射关系,然后只需要考虑怎么输入就可以了.注意因为字符串和map的参数传递很慢,所以如果把查询写成函数,必须对参数进行引用,否则会导致运行超时. code: #include<bits/stdc++.h> using namespac…