STEED Cards(打表 金马五校赛-东华大学)

Problem A : STEED Cards


<a type="button" class="btn btn-default" href="/solution/submit.html?problemId=5284">Submit</a> (Out of Contest)
<center> Time Limit: 1 s </center>

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

 


Author: Corn


#include<iostream>
#include<cstdio>
using namespace std;
 
char s[60][6]={"DEEST","DEETS","DESET","DESTE","DETES",
"DETSE","DSEET","DSETE","DSTEE","DTEES","DTESE","DTSEE","EDEST",
"EDETS","EDSET","EDSTE","EDTES","EDTSE","EEDST","EEDTS","EESDT","EESTD",
"EETDS","EETSD","ESDET","ESDTE","ESEDT","ESETD","ESTDE","ESTED","ETDES","ETDSE",
"ETEDS","ETESD","ETSDE","ETSED","SDEET","SDETE","SDTEE","SEDET","SEDTE",
"SEEDT","SEETD","SETDE","SETED","STDEE","STEDE","STEED","TDEES","TDESE",
"TDSEE","TEDES","TEDSE","TEEDS","TEESD","TESDE","TESED","TSDEE","TSEDE","TSEED"
};
int main()
{
    int n;
    while(cin>>n){
        cout<<s[n-1]<<endl; 
    }
    return 0;
} 





全部评论

相关推荐

03-31 21:47
东南大学 C++
彭于晏前来求offe...:吓晕了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务