George and Accommodation
George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory.
George and Alex want to live in the same room. The dormitory has nnn rooms in total. At the moment the iii-th room has pppi people living in it and the room can accommodate qqqi people in total (pppi ≤ q≤ q

乔治和朋友亚历克斯进入BSUCP大学,并希望住在同一间宿舍。宿舍共有n个房间,每个房间已住人数pi和最大容纳人数qi。任务是找出能同时容纳两人的房间数量。输入包含房间数n及各房间信息,输出符合条件的房间数。
最低0.47元/天 解锁文章
185

被折叠的 条评论
为什么被折叠?



