Hdu 2149 Public Sale Bashi Game Model ~~ Is it really good for me to brush questions like this ~~~, Hdu2149
Public SaleTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission (s): 4914 Accepted Submission (s): 2941
Problem Description does not want to, but the reality is always a reality. Lele never escaped the fate of dropping out of school because he did not receive a scholarship. Now he is waiting for his farmland career like FarmJohn.
Lele heard that there was a special auction on the street, and the auction of items was just a 20-acre field. So Lele took all his savings and rushed to the auction.
Later, we found that the auction only lasted for Lele and Yueyue.
Lele knew the auction rule was as follows: the reserve price was 0 at the beginning, and two people started to raise the price in turn, but each price increase was within 1 ~ Between N, when the price is greater than or equal to the cost of the field M, the organizer will sell the field to the price caller.
Although Lele and Yueyue cannot take the test, they are very proficient in the auction, and both of them really want this field. Therefore, each time they choose the most favorable way to increase their prices.
Because the Lele Lexicographic Order is higher than Yueyue, each time Lele starts to raise the price. Excuse me, when I first raise the price,
How much does Lele need to make sure they can buy this land?
Input this question contains multiple groups of tests. Please process it until the end of the file (EOF ). Each group of tests occupies one row.
Each group of tests contains two integers, M and N (for meanings, see the topic description, 0 <N, M <1100)
For each group of data, Output the price that Lele can add for the first time in the ascending order of a row. The two data are separated by spaces.
If Lele cannot buy the land at whatever bid he made for the first time, it will output "none ".
Sample Input
4 23 23 5
Sample Output
1none3 4 5
The Exe. Memory of my code is 1092 kb, but other people can achieve 0? For example:
My code is not complicated either. How can I beat them so much? Please explain ~~~ Thank you ~~~
The following is my code:
#include <stdio.h>int main(){int m,n;while(~scanf("%d%d",&m,&n)){if(m%(n+1) == 0){puts("none") ;}else{if(m<n){for(int i = m ; i <= n ; ++i){printf("%d",i);if(i!=n){printf(" ");}}puts("");}else{printf("%d\n",m%(n+1)) ;}}}return 0 ;}
Share with Jun