模拟题 题目描述挺长的....

#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 模拟的更多相关文章

  1. UVa 12100 (模拟) Printer Queue

    用一个队列模拟,还有一个数组cnt记录9个优先级的任务的数量,每次找到当前最大优先级的任务然后出队,并及时更新cnt数组. #include <iostream> #include < ...

  2. UVa 101 (模拟) The Blocks Problem

    题意: 有n个木块及n个木块堆,初始状态是第i个木块在第i个木块堆上.对应有四种操作,然后输出最终状态. 分析: 用一个vector<int>模拟一个木块堆,进行相应操作即可. #incl ...

  3. 【每日一题】Flooded! UVA - 815 模拟阅读格式题

    https://cn.vjudge.net/problem/UVA-815 题意:给你一个矩阵,每个格子的数代表一个海拔并且每个格子的面积100平方米.给你整个区域的降水量(立方米),问降水量(米). ...

  4. 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 ...

  5. 【紫书】 Unix ls UVA - 400 模拟

    题意:中文版https://vjudge.net/problem/UVA-400#author=Zsc1615925460 题解:首先读取字符,维护一个最长字符串长度M,再排序. 对于输出,写一个pr ...

  6. UVA - 11995 模拟

    #include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> #i ...

  7. UVA 10205 Stack 'em Up

    直接模拟就好. #include <map> #include <set> #include <list> #include <cmath> #incl ...

  8. Paper Folding UVA - 177 模拟+思路+找规律

    题目:题目链接 思路:1到4是很容易写出来的,我们先考虑这四种情况的绘制顺序 1:ru 2:rulu 3:rululdlu 4:rululdluldrdldlu 不难发现,相较于前一行,每一次增加一倍 ...

  9. uva 101 POJ 1208 The Blocks Problem 木块问题 vector模拟

    挺水的模拟题,刚开始题目看错了,poj竟然过了...无奈.uva果断wa了 搞清题目意思后改了一下,过了uva. 题目要求模拟木块移动: 有n(0<n<25)快block,有5种操作: m ...

随机推荐

  1. List.Select按字符串选择属性

    不知道大家有没有遇到这样的情况:List使用Lambda表达式的时候,想要选择项的某个属性列. 例如,选择编号ID: var idList=list.Select(o=>o.ID).ToList ...

  2. AOJ 0558 Cheese

    Cheese Time Limit : 8 sec, Memory Limit : 65536 KB チーズ (Cheese) 問題 今年も JOI 町のチーズ工場がチーズの生産を始め,ねずみが巣から ...

  3. ZigBee安全相关

    ZigBee安全由AES加密算法和CCM操作方式作为安全方案,广泛使用在ZigBee联盟的通信协议中.ZDO层负责安全策略和安全配置的管理. Technorati 标签: ZigBee 安全 2. 配 ...

  4. 状态模式(State)

    状态模式,从字面意思上来讲应该是很简单的,就是针对实际业务上的内容,当类的内部的状态发生改变时,给出不同的响应体,就像现实中的人一样,早上没有吃饭,状态不好,上班.上课都会打哈欠,中午了,吃过午饭,又 ...

  5. iOS Foundation框架 -4.NSDate类的简单用法

    NSDate为日期时间类对象,简单操作: 注意:直接NSLog输出NSDate对象,默认是以0时区为标准,因此会比北京时间少8小时 1.将Date格式转换为自定义格式的字符串格式 // 自定义Date ...

  6. oracle 备份与还原 及相关操作

    drop user 用户名 cascade; ........删除用户 create user 用户名 identified by 密码 default tablespace 数据文件名 tempor ...

  7. Xcode中为代码添加特殊标记

    有时候,我们需要在代码中搜索特殊的符号或者代码段,根据符号或使用搜索功能导航代码段效率并不算高.为了使用普通的英语标识重要的代码片段,可在代码中插入特殊格式的注释.这些注释不会在应用程序中添加任何特殊 ...

  8. IntellijIDEA 使用技巧

    1:显示工具栏目  toolbar:view ->ToolBar 2:加载源码   new project ->选择java project ->选择源码所在目录 ->ok

  9. 方法的可变长参数 传入参数个数不确定可用(Type ... values)

    /** * 可变长的参数. * 有时候,我们传入到方法的参数的个数是不固定的,为了解决这个问题,我们一般采用下面的方法: * 1. 重载,多重载几个方法,尽可能的满足参数的个数.显然这不是什么好办法. ...

  10. ajax 设置Access-Control-Allow-Origin实现跨域访问

    ajax跨域访问是一个老问题了,解决方法很多,比较常用的是JSONP方法,JSONP方法是一种非官方方法,而且这种方法只支持GET方式,不如POST方式安全. 即使使用jquery的jsonp方法,t ...