编程介的小学生 2019-08-28 17:37 采纳率: 20.5%
浏览 132

Let the Balloon Rise II

Problem Description
Contest will be end at 17:00! How excited it is to see balloons floating around.

I knew you had solved the HDOJ 1004 Let the Balloon Rise already, so please settle the another version quickly. I have a lot of balloons and each has a color and I give each of them a number, same color has the same number. For example, red balloon is No.1, pink is No.2, black is No.3 . etc. I also have many rooms to store all the balloons.
There are some rules :
1. Every room stores several balloons but no two have the same color.
2. Collect all the balloons, we can find each color has even number of times of balloons except one.

Your task is to find which is the odd color and calculate its number of times.

Input
Input file consists from multiple data sets separated by one or more empty lines.
Each data set represents a sequence of 32-bit (positive) integers (references) which are stored in compressed way.
Each line of input set consists from three single space separated 32-bit (positive) integers X Y Z and they represent following sequence of No.X, X+Z, X+2*Z, X+3*Z, …, X+K*Z, …(while (X+K*Z)<=Y). This line represents that in this room there exists (K+1) balloons whose No. is No.X, No.X+Z, No.X+2*Z, No.X+3*Z, …, No.X+K*Z, …etc.

Output
For each input data set you should print to standard output new line of text with two integers separated by single space (first one is No. that occurs odd number of times and second one is count of that kind of balloon).
If all have even number of times output “None.”

Sample Input
1 10 1
1 10 1

1 5 1
6 10 1
1 10 1
4 4 1

1 5 1
2 5 1
2 5 1
2 5 1

Sample Output
None.
4 3
1 1

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
    • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)