天南之城的后花园

记录精彩的程序人生

文章

PAT 1006 签到与签退

1006 Sign In and Sign Out 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 and locked the door on that day. 每天开始时,第一个在电脑房签到的人将解锁门,最后一个签退的人将锁门。给定签到和签退的记录,你需要找出当天解锁和锁门的人。 Input Specification: Each input file contains one test case. Each case contains the records for one day. The case starts with a pos....

PAT 1002 两多项式相加

1002 A+B for Polynomials This time, you are supposed to find A+B where A and B are two polynomials. 这次,你需要找到两个多项式A和B的和。 Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N_1 a_{N1} N_2 a_{N2} ... N_{K} a_{NK} where K is the number of nonzero terms in the polynomial, N_{i} and a_{Ki} (i=1,2,⋯,K) are the exponents and coefficients, respectively. It is given that 1≤K≤10 , 0≤N_{K}<⋯<N_{2}<N_{1}....

记录精彩的程序人生

© 2025 天南之城的后花园

Powered by Bolo
Theme bolo-sakura by Mashiro
浏览 50966 文章 43 评论 11
蜀ICP备2023008301号

主题 | Theme