celebration

PAT甲级【2019年3月考题】——A1157 Anniversary【25】

独自空忆成欢 提交于 2019-12-06 00:50:36
Zhejiang University is about to celebrate her 122th anniversary in 2019. To prepare for the celebration, the alumni association (校友会) has gathered the ID’s of all her alumni. Now your job is to write a program to count the number of alumni among all the people who come to the celebration. Input Specification: Each input file contains one test case. For each case, the first part is about the information of all the alumni. Given in the first line is a positive integer N (≤105 10^510 5 ​​ ). Then N lines follow, each contains an ID number of an alumnus. An ID number is a string of 18 digits or

poj-3682 King Arthur's Birthday Celebration

回眸只為那壹抹淺笑 提交于 2019-12-03 02:40:22
C - King Arthur's Birthday Celebration POJ - 3682 King Arthur is an narcissist who intends to spare no coins to celebrate his coming K -th birthday. The luxurious celebration will start on his birthday and King Arthur decides to let fate tell when to stop it. Every day he will toss a coin which has probability p that it comes up heads and 1- p up tails. The celebration will be on going until the coin has come up heads for K times. Moreover, the king also decides to spend 1 thousand coins on the first day's celebration, 3 thousand coins on the second day's, 5 thousand coins on the third day's .