注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
今天刚参加完微软career fair后的microsoft college code competition,虽然官方只说有奖品啥的,但是好像答的好会直接有interview,所以po在这个版,不知道合不合适。
一共六道题,难的三分,简单的一分,中等的两份,可以三个人组队参加,用任意语言,要把最终结果和代码上传,结果对就会给分。
第一题是三分题,有一种病毒,但是疫苗有限,要先给得病的概率高的人免疫,所以要计算得病概率,得病的概率是个人的基因跟病毒基因比较,看重复部分的长度有多长,跟总长度比较。输出接种的次序。
第二题两分题,忘记了,
第三题两分,是unicode的一道题,不是太熟,就没做这个。
第四题两分,是用software实现vending machine, 感觉corner case挺多的。
第五题一分,是给出一个txt文档,每一行有两个字符串,判断他俩是不是anagram,并输出。这个记得career cup上有非常类似的题。当然实际做的时候输入输出的函数要自己写。
第六题一分,给出一段代码,有go to和next等命令,判断是否有死循环,compiler里的经典方法。
本人很水~得分不是很高,他这个下周在别的学校好像还有,感兴趣的小伙伴赶紧组队参加吧。
隐藏部分是第一个题的原题,感兴趣的同学可以看一下。 There is an outbreak of VirusX in Redmond. The local authorities have discovered a vaccine that protects against infection by VirusX. However, they can only produce so many vaccines per week. Your job is to figure out the best order in which people should be vaccinated. Everyone will get vaccinated, but the people more likely to be sick should be vaccinated first. You are more likely to get sick if the virus` DNA closely matches somewhere in your DNA.
However, there is a catch: the virus can mutate. Over time, the virus can “cut” letters from its DNA. So it is possible that the AAAAG virus mutates into the AAAG, AAAA, …, A viruses. Removing letters is the only
The below example becomes clear if we give the “DNA match score” as well as the longest sequence of DNA matched.
Person #0: G, 0.333
Person #1: GCC, 1.000
Person #2: CC, 0.667
Person #3: GC, 0.667
Person #4: GC, 0.667
Person 1 has a 1.0 probability of getting sick, so he gets vaccinated first. Persons 2, 3, and 4 are the next highest probable to get sick, so they get vaccinated second. Person 0 has the least chance to get sick; he gets vaccinated last.
Example input
5 10 3
AGGAAAAGAG
CGAGGCCAAC
GACAAAACCG
GCGACGCAGA
AACAGCGCAG
GCC
Example output
Person #0: 3.
Person #1: 1.
Person #2: 2.
Person #3: 2.
Person #4: 2.
|