Boostable

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  C/C++

摘要:1006. Sign In and Sign Out (25) At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you are supposed to find the ones who have unlocked a... 阅读全文
posted @ 2014-02-10 21:17 Boostable 阅读(341) 评论(0) 推荐(0)

摘要:1005. Spell It Right (20) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each case occupies one line which contains an N (2#include3... 阅读全文
posted @ 2014-02-10 15:33 Boostable 阅读(159) 评论(0) 推荐(0)

摘要:1004. Counting Leaves (30) A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contains one test case. Each case starts with a line containing 0 2#include34intmain()5{6intN,M;7intTree[100][10... 阅读全文
posted @ 2014-02-10 15:07 Boostable 阅读(187) 评论(0) 推荐(0)

摘要:1003. Emergency (25) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are marked on ... 阅读全文
posted @ 2014-02-09 20:23 Boostable 阅读(240) 评论(0) 推荐(0)

摘要:1002. A+B for Polynomials (25) This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 ... NK aNK, where K is the numbe... 阅读全文
posted @ 2014-02-07 23:15 Boostable 阅读(195) 评论(0) 推荐(0)

摘要:Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Each input file contains one test case. Each case contains a pair of integers a and b where -1000000 2intmain()3{4inta,b... 阅读全文
posted @ 2014-02-07 23:12 Boostable 阅读(246) 评论(0) 推荐(0)