2017年上海金马五校程序设计竞赛 A : STEED Cards 暴力

Description

Corn does not participate the STEED contest, but he is interested in the word "STEED". So, Corn writes all permutations of the word "STEED" on different cards and gets 60 cards finally.

Corn sorts these cards in lexicographical order, and marks them from 1 to 60.

Now, Corn gives you a integer N (1 ≤ N ≤ 60), could you tell him the word on the Nth card?

 

Input

There are multiple test cases (no more than 60).
For each test case, there is one integer N (1 ≤ N ≤ 60) in a line.

 

Output

For each test case, you should output one line with the word on the Nth card.

 

Sample Input

1
2
3
4
47
48
49

 

Sample Output

DEEST
DEETS
DESET
DESTE
STEDE
STEED
TDEES


个人比较懒哟,看到只有60种情况,不想动脑筋了,直接把六十个情况列出来,也不是很久,也不会超时,真的感觉懒得可以了,哈哈




#include <iostream>
#include <cstring>
using namespace std;
int main(){
	char a[62][10];
	strcpy(a[0],"DEEST");
	strcpy(a[1],"DEETS");
	strcpy(a[2],"DESET");
	strcpy(a[3],"DESTE");
	strcpy(a[4],"DETES");
	strcpy(a[5],"DETSE");
	strcpy(a[6],"DSEET");
	strcpy(a[7],"DSETE");
	strcpy(a[8],"DSTEE");
	strcpy(a[9],"DTEES");
	strcpy(a[10],"DTESE");
	strcpy(a[11],"DTSEE");
	strcpy(a[12],"EDEST");
	strcpy(a[13],"EDETS");
	strcpy(a[14],"EDSET");
	strcpy(a[15],"EDSTE");
	strcpy(a[16],"EDTES");
	strcpy(a[17],"EDTSE");
	strcpy(a[18],"EEDST");
	strcpy(a[19],"EEDTS");
	strcpy(a[20],"EESDT");
	strcpy(a[21],"EESTD");
	strcpy(a[22],"EETDS");
	strcpy(a[23],"EETSD");
	strcpy(a[24],"ESDET");
	strcpy(a[25],"ESDTE");
	strcpy(a[26],"ESEDT");
	strcpy(a[27],"ESETD");
	strcpy(a[28],"ESTDE");
	strcpy(a[29],"ESTED");
	strcpy(a[30],"ETDES");
	strcpy(a[31],"ETDSE");
	strcpy(a[32],"ETEDS");
	strcpy(a[33],"ETESD");
	strcpy(a[34],"ETSDE");
	strcpy(a[35],"ETSED");
	strcpy(a[36],"SDEET");
	strcpy(a[37],"SDETE");
	strcpy(a[38],"SDTEE");
	strcpy(a[39],"SEDET");
	strcpy(a[40],"SEDTE");
	strcpy(a[41],"SEEDT");
	strcpy(a[42],"SEETD");
	strcpy(a[43],"SETDE");
	strcpy(a[44],"SETED");
	strcpy(a[45],"STDEE");
	strcpy(a[46],"STEDE");
	strcpy(a[47],"STEED");
	strcpy(a[48],"TDEES");
	strcpy(a[49],"TDESE");
	strcpy(a[50],"TDSEE");
	strcpy(a[51],"TEDES");
	strcpy(a[52],"TEDSE");
	strcpy(a[53],"TEEDS");
	strcpy(a[54],"TEESD");
	strcpy(a[55],"TESDE");
	strcpy(a[56],"TESED");
	strcpy(a[57],"TSDEE");
	strcpy(a[58],"TSEDE");
	strcpy(a[59],"TSEED");
	int n;
	while(scanf("%d",&n)!=EOF){
		printf("%s\n",a[n-1]);
	}
}


  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

_我走路带风

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值