
队列和优先队列
文章平均质量分 88
coding__girl
这个作者很懒,什么都没留下…
展开
-
POJ 2062 Card Game Cheater
Adam and Eve play a card game using a regular deck of 52 cards. The rules are simple. The players sit on opposite sides of a table, facing each other. Each player gets k cards from the deck and, after原创 2017-10-02 14:53:13 · 333 阅读 · 0 评论 -
POJ 2051 Argus
A data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs such as Web usage log原创 2017-10-02 14:36:32 · 249 阅读 · 0 评论 -
UVA 144 Student Grants
The Government of Impecunia has decided to discourage tertiary students by making the payments of tertiary grants a long and time-consuming process. Each student is issued a student ID card which has a原创 2017-10-02 16:23:23 · 530 阅读 · 0 评论 -
UVA 170 Clock Patience
题意: 将牌依次分成13堆,牌面朝下,按从1到13的顺序发牌,然后从第K堆第一张开始翻牌,然后将该牌放在这一堆的最下面,面朝上,接着翻牌面上显示的数字那一堆的第一张面朝下的牌,重复此过程,直到所有牌都面朝上,输出翻牌的次数以及最后一次翻的牌 思路: 用队列数组保存13堆牌,用结构体存储每张牌的面值、花色、面朝上/朝下,然后模拟翻牌过程#include <iostream>#include原创 2017-10-02 16:47:33 · 343 阅读 · 0 评论 -
UVA 336 A Node Too Far
题意: 给出点的个数及各个点之间的联通情况,输出从某点开始沿联通图路线走n步后不能到达的点的个数,0 0结束 思路: 用bfs搜索每个点#include <iostream>#include <map>#include <queue>#include <vector>using namespace std;//int vis[1000];int N,T,cnt;map<int,v原创 2017-10-02 17:09:24 · 413 阅读 · 1 评论 -
UVA 417 Word Index
Encoding schemes are often used in situations requiring encryption or information storage/transmission economy. Here, we develop a simple encoding scheme that encodes particular types of words with ve原创 2017-10-02 17:30:08 · 429 阅读 · 0 评论 -
UVA 439 Knight Moves
A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to nd the shortest closed tour of knight moves that visits each square of a given set of n squares on a chessboard原创 2017-10-02 17:40:45 · 222 阅读 · 0 评论 -
UVA 532 Dungeon Master
You are trapped in a 3D dungeon and need to nd the quickest way out! The dungeon is composed of unit cubes which may or may not be lled with rock. It takes one minute to move one unit north, south, e原创 2017-10-03 13:48:29 · 256 阅读 · 0 评论 -
UVA 10142 Australian Voting
Australian ballots require that the voter rank the candidates in order of choice. Initially only the first choices are counted and if one candidate receives more than 50% of the vote, that candidate is原创 2017-10-03 14:20:41 · 480 阅读 · 0 评论