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 ...
随机推荐
- UI2_视图切换
// // ViewController.m // UI2_视图切换 // // Created by zhangxueming on 15/7/1. // Copyright (c) 2015年 z ...
- Python 字典(Dictionary) setdefault()方法
描述 Python 字典(Dictionary) setdefault() 函数和get()方法类似, 如果键不已经存在于字典中,将会添加键并将值设为默认值. 语法 setdefault()方法语法: ...
- AMQ学习笔记 - 20. 使用Apache ActiveMQBrowser监控ActiveMQ
概述 Apache ActiveMQBrowser可以用于查看AMQ中的消息.这里对其使用方法进行简单介绍. 使用介绍 1.下载并解压缩 下载地址:Apache ActiveMQBrowser,当前最 ...
- Optimistic Offline Lock乐观离线锁
通过冲突检测和(发生冲突时的)事务回滚,来防止并发业务事务中的冲突. 通常一个业务事务的执行,会跨越一系列的系统事务. 一旦超出了单个系统事务的范围,就不能仅依靠DB管理程序来保证数据一致性. 乐观离 ...
- 《squid网卡代理的实现》RHEL6.3——条理清晰,步骤明确
网卡的代理和FQ差不多一个道理.ping 不通不代表不能上网. 实验的目的: 打开2台虚拟主机,一台2个网卡(这台为服务器):一台一个网卡: 2块网卡的服务器使用静态ip可以上网,也就是说网段为1的可 ...
- 主引导记录MBR
作者:马 岩(Furzoom) (http://www.cnblogs.com/furzoom/)版权声明:本文的版权归作者与博客园共同所有.转载时请在明显地方注明本文的详细链接,未经作者同意请不要删 ...
- [DevExpress]ChartControl之时间轴示例
关键代码: using System; using System.Data; using System.Windows.Forms; using DevExpress.XtraCharts; name ...
- js中隐式类型转换测试
javascript数据类型: 使用typeof可以返回的数据类型有六种 "number" , "string" , "boolean" ...
- [精校版]The Swift Programming Language
通常来说,编程语言教程中的第一个程序应该在屏幕上打印“Hello, world”.在 Swift 中,可以用一行代码实现: println("hello, world") 如 ...
- jquery中简易tab切换
<!doctype html> <html> <head> <title>test</title> <meta content=&qu ...