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 ...
随机推荐
- PropertyGrid排序
解决PropertyGrid对自定义属性排序的问题. 参考了:http://www.cnblogs.com/greatverve/archive/2012/02/08/propergrid-order ...
- 理解C#系列 / 核心C# / 名称空间
名称空间namespace 名称空间 名称空间用来逻辑分类,而不是物理上的,名称空间与程序集无关[程序集:经由编译器编译得到的文件],同一个程序集中可以有2不同的名称空间,也可以在不同的程序集中定义同 ...
- UI6_UIAlertContrller
// // ViewController.m // UI6_UIAlertContrller // // Created by zhangxueming on 15/7/7. // Copyright ...
- 【转载】#273 - Parameter Modifier Summary
Here's a summary of the different parameter modifiers and how the behavior changes for each, when us ...
- SpringMvc入门三----控制器
在传统的Spring MVC开发方法中,必须在Bean配置文件中为每个控制器类配置实例和请求映射和让每个控制器类去实现或者扩展特定于框架的接口或者基类,不够灵活. 如果Spring MVC可以自动侦测 ...
- 杭电ACM2057--A + B Again
这是题目 A + B Again 这是源代码: #include <stdio.h> int main() { __int64 a,b; while (scanf("%I64X ...
- Codevs 1078 ==Poj 1258 Agri-Net
Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 53270 Accepted: 22140 Description D ...
- hidden(隐藏域)
<input type="hidden">? 这等于是隐藏值,客户端无需显示,但提交后后台能够接受,例如你放个表单验证值在里边,这样可以拒绝来源不明的表单提交.还有判断 ...
- 3月3日(6) Climbing Stairs
原题 Climbing Stairs 求斐波那契数列的第N项,开始想用通项公式求解,其实一个O(n)就搞定了. class Solution { public: int climbStairs(int ...
- 如何将HDL文件实例化到XPS中
本文转载自:http://xilinx.eetrend.com/blog/7073 硬件平台:ZedBoard 开发环境:XPS + ISE 操作系统:WinXP SP3 一直说要研究官方的例子 ...