uva 10205 模拟
模拟题 题目描述挺长的....
- #include <cstdio>
- #include <cstdlib>
- #include <cmath>
- #include <map>
- #include <set>
- #include <queue>
- #include <stack>
- #include <vector>
- #include <sstream>
- #include <string>
- #include <cstring>
- #include <algorithm>
- #include <iostream>
- #define maxn 1010
- #define INF 0x7fffffff
- #define inf 10000000
- #define MOD 34943
- #define ull unsigned long long
- #define ll long long
- using namespace std;
- char pp[55][25] = {"",
- "2 of Clubs","3 of Clubs",
- "4 of Clubs","5 of Clubs",
- "6 of Clubs","7 of Clubs",
- "8 of Clubs","9 of Clubs",
- "10 of Clubs","Jack of Clubs",
- "Queen of Clubs","King of Clubs",
- "Ace of Clubs",
- "2 of Diamonds","3 of Diamonds",
- "4 of Diamonds","5 of Diamonds",
- "6 of Diamonds","7 of Diamonds",
- "8 of Diamonds","9 of Diamonds",
- "10 of Diamonds","Jack of Diamonds",
- "Queen of Diamonds","King of Diamonds",
- "Ace of Diamonds",
- "2 of Hearts","3 of Hearts",
- "4 of Hearts","5 of Hearts",
- "6 of Hearts","7 of Hearts",
- "8 of Hearts","9 of Hearts",
- "10 of Hearts","Jack of Hearts",
- "Queen of Hearts","King of Hearts",
- "Ace of Hearts",
- "2 of Spades","3 of Spades",
- "4 of Spades","5 of Spades",
- "6 of Spades","7 of Spades",
- "8 of Spades","9 of Spades",
- "10 of Spades","Jack of Spades",
- "Queen of Spades","King of Spades",
- "Ace of Spades"
- };
- int shu[110][55], now[55], ans[55], n;
- void init()
- {
- memset(shu, 0, sizeof(shu));
- for(int i = 1; i <= 52; ++ i) now[i] = i;
- scanf("%d", &n);
- for(int i = 1; i <= n; ++i)
- for(int j = 1; j <= 52; ++ j)
- scanf("%d", &shu[i][j]);
- getchar();
- }
- void solve(int k)
- {
- for(int i = 1; i <= 52; ++ i)
- ans[i] = now[shu[k][i]];
- for(int i = 1; i <= 52; ++ i)
- now[i] = ans[i];
- }
- int main()
- {
- int t, k;
- scanf("%d", &t);
- while(t --)
- {
- init();
- char s[10];
- while(gets(s) && s[0] != 0)
- {
- sscanf(s, "%d", &k);
- solve(k);
- }
- for(int i = 1; i <= 52; ++ i)
- puts(pp[ans[i]]);
- if(t) puts("");
- }
- return 0;
- }
uva 10205 模拟的更多相关文章
- UVa 12100 (模拟) Printer Queue
用一个队列模拟,还有一个数组cnt记录9个优先级的任务的数量,每次找到当前最大优先级的任务然后出队,并及时更新cnt数组. #include <iostream> #include < ...
- UVa 101 (模拟) The Blocks Problem
题意: 有n个木块及n个木块堆,初始状态是第i个木块在第i个木块堆上.对应有四种操作,然后输出最终状态. 分析: 用一个vector<int>模拟一个木块堆,进行相应操作即可. #incl ...
- 【每日一题】Flooded! UVA - 815 模拟阅读格式题
https://cn.vjudge.net/problem/UVA-815 题意:给你一个矩阵,每个格子的数代表一个海拔并且每个格子的面积100平方米.给你整个区域的降水量(立方米),问降水量(米). ...
- UVA大模拟代码(白书训练计划1)UVA 401,10010,10361,537,409,10878,10815,644,10115,424,10106,465,10494
白书一:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=64609#overview 注意UVA没有PE之类的,如果PE了显示WA. UVA ...
- 【紫书】 Unix ls UVA - 400 模拟
题意:中文版https://vjudge.net/problem/UVA-400#author=Zsc1615925460 题解:首先读取字符,维护一个最长字符串长度M,再排序. 对于输出,写一个pr ...
- UVA - 11995 模拟
#include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #i ...
- UVA 10205 Stack 'em Up
直接模拟就好. #include <map> #include <set> #include <list> #include <cmath> #incl ...
- Paper Folding UVA - 177 模拟+思路+找规律
题目:题目链接 思路:1到4是很容易写出来的,我们先考虑这四种情况的绘制顺序 1:ru 2:rulu 3:rululdlu 4:rululdluldrdldlu 不难发现,相较于前一行,每一次增加一倍 ...
- uva 101 POJ 1208 The Blocks Problem 木块问题 vector模拟
挺水的模拟题,刚开始题目看错了,poj竟然过了...无奈.uva果断wa了 搞清题目意思后改了一下,过了uva. 题目要求模拟木块移动: 有n(0<n<25)快block,有5种操作: m ...
随机推荐
- hibernate get VS load
1. 执行get方法:会立即加载对象 而执行load方法,若不适用该对象,则不会立即执行查询操作,而返回一个代理对象 get立即检索,load延迟检索 2. load方法可能 ...
- 模板:abs用法
c语言书本上说,数学函数除了求整数的绝对值函数abs()之外<abs() 定义在stdlib.h中>,其余的函数都在头文件 math.h 中定义,包括对浮点数求绝对值的函数fabs().c ...
- 解决Eclipse中Java工程间循环引用而报错的问题
如果myeclipse 报如下错误 A cycle was detected in the build path of project 如果我们的项目包含多个工程(project),而它们之间又是循 ...
- mysql中按string字段排序
如: Sql代码SELECT * FROM Student WHERE 1 = 1 ORDER BY -ID DESC或者: Sql代码SELECT * FROM Student WHERE 1 = ...
- HTML5应用开发:JavaScript库iScroll教程
目录 1. iScroll介绍 2. 安装和使用 3. 简单的iScroll例子 4. Pinch & Zoom 5. Snap to element 6. iScroll 详细参数 1. i ...
- 浅谈 WPF布局
我们首先来了解一下图形化用户界面(Graphic User Interface)也就是我们常常听到的GUI.举个简单的例子,同样是数据,我们可以用控制台程序加格式控制符等输出,但是这些都不如GUI来的 ...
- springMVC之事务配置(问题来源:为什么数据保存不了)
参考文章:http://www.cnblogs.com/leiOOlei/p/3725911.html 自己的亲身体会,来源问题this.sessionFactory.getCurrentSessio ...
- 【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports
http://www.cnblogs.com/shanyou/archive/2013/02/12/2910232.html SQL Server Performance Dashboard Repo ...
- 非阻塞io与记录锁
非阻塞io 1.对比 阻塞io的例子:scanf从终端获取输入时,如果不输入程序就会一直停在那; 对一个已经有写锁的文件请求读时, 会一直空等直到前面的进程释放锁... 非阻塞的例子:读取文件内容, ...
- Activity的Launch mode详解 singleTask正解
Activity有四种加载模式:standard(默认), singleTop, singleTask和 singleInstance.以下逐一举例说明他们的区别: standard:Activity ...