https://codeforces.com/contest/1236/problem/B Alice got many presents these days. So she decided to pack them into boxes and send them to her friends. There are nn kinds of presents. Presents of one kind are identical (i.e. there is no way to disting…
学习sql中的排列组合,在园子里搜着看,看到篇文章,于是自己(新手)用了最最原始的sql去写出来: --需求----B, C, F, M and S住在一座房子的不同楼层.--B 不住顶层.C 不住底层.--F 既不住顶层也不住底层.M 住得比 C 高.--S 住的楼层和 F 不相邻.--F 住的楼层和 C 不相邻. create table pailie (rnam varchar(20) ) select 'B' as rnam into #y union select 'C' union…
一般用dfs来做 最简单的一种: 17. Letter Combinations of a Phone Number Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit s…