uva10935专题

uva10935(栈)

Problem B: Throwing cards away I 对于此题,我只能说很无奈,就是因为输入1的时候没有控制好,所以答案一直是错误的! Given is an ordered deck of n cards numbered 1 to nwith card 1 at the top and card n at the bottom.The following op

算法竞赛入门经典 第二版 习题5-3 卡片游戏 Throwing cards away I uva10935

题目:https://vjudge.net/problem/UVA-10935 思路:用deque模拟即可,注意n=1时的格式问题,让我格式错误了一次。 代码: #include <iostream>#include <string>#include <sstream>#include <cstdio>#include <iomanip>#include <map>#includ