- 浏览: 36659 次
- 性别:
- 来自: 杭州
最新评论
扑克洗牌
#include <iostream> #include <string> #include <vector> #include <iomanip> #include <map> #include <algorithm> using namespace std; void Createpoker(vector<string> &poker, string s) { for (int i = 1; i < 14; i++) { if (i > 9) { string str = s + "1"; char c = i%10 + '0'; str = str + c; poker.push_back(str); } else { string str = s; char c = i + '0'; str = str + c; poker.push_back(str); } } } int main() { vector<string> poker; Createpoker(poker, "S"); Createpoker(poker, "H"); Createpoker(poker, "C"); Createpoker(poker, "D"); poker.push_back("J1"); poker.push_back("J2"); int K; cin>>K; vector<int> sortnum; int m = 54; while(m--) { int x; cin>>x; sortnum.push_back(x - 1); } vector<string> result(54,""); while(K--) { for (int i = 0; i < 54; i++) { result[sortnum[i]] = poker[i]; } poker.clear(); poker.insert(poker.end(),result.begin(),result.end()); } for (int i = 0; i < 53; i++) { cout<<result[i]<<" "; } cout<<result[53]; return 0; }
发表评论
-
PAT1013 Battle Over Cities
2012-11-29 23:59 773Sample Input 3 2 3 1 2 1 3 ... -
PAT1003 Emergency
2012-11-29 23:46 662Sample Input 5 6 0 2 1 2 1 ... -
PAT1041 Be Unique
2012-11-23 23:43 761找出只出现过一次的数,用各种排序必然超时,需要用数组做hash ... -
PAT1040 Longest Symmetric String
2012-11-23 23:41 960求最长回文子串 #include < ... -
PAT1036 Boys vs Girls
2012-11-23 23:41 716Sample Input 1: 3 Joe M Mat ... -
PAT1035 Password
2012-11-23 23:40 617Sample Input 1: 3 Team0000 ... -
PAT1031 Hello World for U
2012-11-22 23:54 656Sample Input: helloworld! S ... -
PAT1029 Median
2012-11-22 23:54 651用标准库的排序全部超时,需要自己实现,另外还不能用cin co ... -
PAT1028 List Sorting
2012-11-22 23:53 809用vector最后一个用例超时了。。。 Sample ... -
PAT1027 Colors in Mars
2012-11-22 23:52 624Sample Input 15 43 71 Samp ... -
PAT1025 PAT Ranking
2012-11-22 23:51 772Sample Input: 2 5 123456789 ... -
PAT1023 Have Fun with Numbers
2012-11-21 23:55 687大数的相加 比较两个字符串中字符完全相同 Sa ... -
PAT1020 Tree Traversals
2012-11-21 23:54 653已知中序遍历 后序遍历,求层次遍历 Sample In ... -
PAT1019 General Palindromic Number
2012-11-21 23:53 537十进制转任意进制,并比较是否是回文数 Sample I ... -
PAT1037 Magic Coupon
2012-11-21 15:46 664Sample Input: 4 1 2 4 -1 ... -
PAT1038 Recover the Smallest Number
2012-11-20 23:52 1668由一道面试题改的 把数组排成最小的数 不同之处是这 ... -
PAT1024 Palindromic Number
2012-11-20 23:51 648Sample Input 1: 67 3 Sampl ... -
PAT1015 Reversible Primes
2012-11-19 23:51 771十进制转任意进制 假设十进制数为number,转 ... -
PAT1012 The Best Rank
2012-11-19 23:50 927四门功课,输出排名最高的是哪个 Sample Inpu ... -
PAT1011 World Cup Betting
2012-11-19 23:50 534Sample Input 1.1 2.5 1.7 1.2 ...
相关推荐
PTA中Shuffling Machine的中文版,非常简单的代码,新手练
基于RFID技术的图书馆书架顺架系统的研究,郑智侃,王东,本文研究了对一种基于RFID技术的图书馆书架智能顺架系统做了基础性研究.在研究我们提出了一种全新的在架书籍的定位模型,并通过一系
通过shuffling方法构建能够感染乳腺癌细胞的嵌合型AAV病毒研究,严巧灵,赵景川,本文就是采用DNA shuffling的方法,将九种不同来源的亲本型AAV病毒AAV1-AAV9通过PCR方法扩增出衣壳基因cap片段,产生一系列不同亲本...
DNA Shuffling建库筛选靶向感染鼻咽癌细胞的腺相关病毒,潘素晶,张悦,目的:构建嵌合腺相关病毒( Chimeric Adeno-associated virus,cAAV)文库,筛选获得一种对CNE-3鼻咽癌细胞高效感染且靶向性专一的嵌合AAV。...
利用genome shuffling技术提高光滑球拟酵母的丙酮酸生产效率,刘立明,许庆龙,摘要:以解除了酵解抑制的光滑球拟酵母突变株DN11和解除了产物抑制的突变株RS23为亲本菌株,经三轮genome shuffling操作获得了最佳重组...
利用DNA Shuffling技术进化靶向卵巢癌细胞的腺相关病毒,张悦,潘素晶,在过去的几年里,重组腺相关病毒(rAAV)作为基因治疗载体,在转导肝脏,心脏以及视网膜等方面取得了可观的成果。然而,AAV病毒的�
超松弛再生matlab代码T2混洗示范代码 MRM手稿的演示代码T2混洗:清晰,多对比度,体积快速自旋回波成像[1]。 由乔恩·塔米尔(Jon Tamir)撰写。 如果有问题,请随时与我联系或在存储库页面上发布问题。...
机器学习的特征选择-代码存储库 2018年2月发布链接目录基本选择方法删除常量功能删除准恒定特征删除重复的功能相关特征选择删除相关功能基本选择方法+相关-管道过滤方法:单变量统计方法相互信息卡方分布阿诺娃基本...
此振荡器专门针对恒压恒流(CV-CC)控制、频率抖动(Frequency Shuffling)技术。采用电流模脉宽调制控制方案的电池充电芯片设计,锯齿波信号的线性度较好,当负载电路减小时,自动进入Burst Mode状态提高系统的效率。...
洗牌 可用于洗牌的各种算法
CS146_DataShuffling A部分–数据混排建议的解决方案: 我通过读取给定文件并将行放入数组中,使用Fisher-Yates算法对数组进行混洗,然后逐个元素将新混洗的数组写入新文件来实现数据混排程序。...
4. shuffling:由于 `Mapping` 操作可能是在不同的机器上并行处理的,所以需要通过 `shuffling` 将相同 `key` 值的数据分发到同一个节点上去合并,这样才能统计出最终的结果,此时得到 `K2` 为每一个单词,`List(V2)...
3.(7.30 Card Shuffling and Dealing) Modify the application of Fig. 7.11 to deal a five-card poker hand. Then modify class DeckOfCards of Fig. 7.10 to include methods that determine whether a hand ...
bitext.c: kernel little helper (of bit shuffling variety).
All componments aupport the properties page,correct icons, OLE Drag&Drop, the Explorer context menu and shuffling it withyour Delphi popup menus. A thumbnail component displays the Explorer ...
All componments aupport the properties page, correct icons, OLE Drag&Drop, the Explorer context menu and shuffling it with your Delphi popup menus. A thumbnail component displays the Explorer ...
Comprehensive, advanced coverage of C# 5.0 and .NET 4.5.1 Whether you're a C# guru or ...Shuffling of ADO.NET Entity Framework Additions to Windows Workflow Foundation New Windows Runtime 2.0 updates
通过Bit Shuffling和base64编码混淆字符串(如D.Knuth的第4a卷第7.1.3章所述)。此方法生成的结果较小(生成的脚本约小66%) 将长的串联行合并到变量附加中,以避免最大数量的连续行(24) 垃圾插入,足够聪明,...
and after image shuffling, and possible inaccurate scores for synthesized images. Statistical tests pertinent to this new measure are also derived. This new measure is therefore both quantitative and ...
A Flash image shuffling from CCTV network advertising effects