• One is an interesting integer. This is also an interesting problem. You are assigned with a simple task. Find N (3 ) different positive integers Ai (1 ), and Any possible answer will be accepted. ...
• To Be NUMBER ONE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 408 Accepted Submission(s): 207 Special Judge Problem Description On
To Be NUMBER ONE
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 408    Accepted Submission(s): 207Special JudgeProblem Description
One is an interesting integer. This is also an interesting problem. You are assigned with a simple task.
Find N (3 <= N <= 18) different positive integers Ai (1 <= i <= N), and

Any possible answer will be accepted.

Input
No input file.

Output
Your program’s output should contain 16 lines:
The first line contain 3 integers which are the answer for N = 3, separated by a single blank.

The following 15 lines are the answer for N = 4 to 18, as the same format.
The sample output is the first two lines of a possible output.

Sample Output

2 3 6
2 4 6 12 /*
思路：
一个倒数可以分解问2个数的倒数之和
1/n= 1/(a*b)=1/a*(a+b) + 1/b*(a+b)
*/
#include<iostream>
#include<cmath>
using namespace std ;
int main(void)
{
int a[100] ,cnt = 0 ;
a[0] = 2 ;
a[1] = 3 ;
a[2] = 6 ;
int k = 3 ;
while(cnt < 16)
{
int i ;
for( i = 0 ; i < cnt + 2 ; i ++)
cout<<a[i]<<" ";
cout<<a[cnt+2]<<endl;

int j ,flag = 0 ;
for( i = 0 ; i < cnt + 3 ; i ++){
for( j = 2 ; j <= a[i] ; j ++)
{
if(a[i] % j == 0 )
{
int b , c , d , tag = 0 , tag1 = 0 ;
d = a[i] / j ;
b = j*( j + d) ;
c = d * ( j + d ) ;
if(!(b<=(k+1)*(k+1) && c <=(k+1)*(k+1)))
continue ;
for(int l = 0 ; l < k ; l++)
if(a[l] == b){
tag = 1;
break;
}
for( l = 0 ; l < k ; l ++)
if(a[l] == j){
tag1 = 1;
break;
}
if(tag == 0 || tag == 0)
{
a[i] = b ;
a[k ++] =c ;
flag = 1;
break;
}

}
}
if(flag)
break;
}
cnt ++ ;
}
return 0;
}


展开全文
• To Be NUMBER ONE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 395 Accepted Submission(s): 196 Special Judge Problem Description


To Be NUMBER ONE
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 395    Accepted Submission(s): 196Special Judge
Problem Description

One is an interesting integer. This is also an interesting problem. You are assigned with a simple task.
Find N (3 <= N <= 18) different positive integers Ai (1 <= i <= N), and

Any possible answer will be accepted.

Input

No input file.

Output

Your program’s output should contain 16 lines:
The first line contain 3 integers which are the answer for N = 3, separated by a single blank.
The following 15 lines are the answer for N = 4 to 18, as the same format.
The sample output is the first two lines of a possible output.

Sample Output

2 3 6
2 4 6 12

Author

iSea@WHU

Source

The
6th Central China Invitational Programming Contest and 9th Wuhan University Programming Contest Preliminary

Recommend

lcy

算法思想 ：

对分母进行分解：
n可以分解成     1/n  =  1/(n+1)   +  1/(n+1)*n
例如   从2 3 6 开始
不能有相同的 所以只能从 2分解成 3 6 前面已经含有了，然后只能从3开始改
下一项变成 2 4 6 12
下一项不能分解 2因为会多出来6 所以应当选择 2 5 6 12 20
post code:

#include<stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;

int a[21][21];
int b[21];
int main()
{
a[3][1]=2;
a[3][2]=3;
a[3][3]=6;
int i,j,k,len,temp,flag=0;
for( i=3; i<=17; i++ )
{
len=i;

for( j=1; j<=len; j++)
{
b[j] = a[i][j];
}
for( j=1; j<=len; j++)
{
flag=0;
if(b[j]+1!=b[j+1]){     temp=b[j]*(b[j]+1);
for(k=1;k<=len;k++)
{
if(temp==b[k]){flag=1;break;}
}
if(flag==1)continue;
b[j]=b[j]+1;
b[len+1]=temp;
break;
}
}
sort(b+1,b+len+1+1);
for( j=1; j<=len+1; j++)
{

a[i+1][j]=b[j];
}

}
for( i=3; i<=18; i++ )
{
for( j=1; j<=i; j++ )
{
printf("%d",a[i][j]);
if(j!=i)printf(" ");
}
printf("\n");
}

}


展开全文
• One is an interesting integer. This is also an interesting problem. You are assigned with a simple task. Find N (3 ) different positive integers Ai (1 ), and Any possible answer will ...
这是一道典型的数学题，只要套公式即可。
1/n=1/(n+1)+1/(1+n)*(n)
2分解成3和6，3分解成4和12，4分解成5和20。。。。注意每次从最小的分解。
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)
Total Submission(s) : 6 Accepted Submission(s) : 4
Special Judge

Font:
Times New Roman | Verdana | Georgia
Font Size:
← →
Problem Description
One is an interesting integer. This is also an interesting problem. You are assigned with a simple task.
Find N (3 <= N <= 18) different positive integers Ai (1 <= i <= N), and

Any possible answer will be accepted.

Input
No input file.

Output
Your program’s output should contain 16 lines:
The first line contain 3 integers which are the answer for N = 3, separated by a single blank.

The following 15 lines are the answer for N = 4 to 18, as the same format.
The sample output is the first two lines of a possible output.
Sample Output

2 3 6
2 4 6 12

代码：
#include<iostream>
using namespace std;
int f[400];
int main()
{
int i,j,flag;
memset(f,0,sizeof(f));
f[2]=1;
f[3]=1;
f[6]=1;
printf("2 3 6\n");
i=4;
while(i<=18)
{
i++;
for(j=2;j<=i*i;j++)
{
if(f[j]&&!f[j+1]&&!f[(j+1)*j])
{
f[j]=0;
f[j+1]=1;
f[(j+1)*j]=1;
break;
}
}
flag=1;
for(j=2;j<=(i+1)*(i+1);j++)
{
if(f[j])
{
if(flag){ printf("%d",j);flag=0;}
else printf(" %d",j);
}
}
printf("%\n");
}
//system("pause");
return 0;
}




展开全文
• To Be NUMBER ONE Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 383 Accepted Submission(s): 190 Special Judge Problem Description On
To Be NUMBER ONE
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 383    Accepted Submission(s): 190Special JudgeProblem Description
One is an interesting integer. This is also an interesting problem. You are assigned with a simple task.
Find N (3 <= N <= 18) different positive integers Ai (1 <= i <= N), and

Any possible answer will be accepted.

Input
No input file.

Output
Your program’s output should contain 16 lines:
The first line contain 3 integers which are the answer for N = 3, separated by a single blank.

The following 15 lines are the answer for N = 4 to 18, as the same format.
The sample output is the first two lines of a possible output.

Sample Output

2 3 6
2 4 6 12

题意
分别用3到18个数 的倒数相加 等于1
并且每个数要求 小于等于 个数+1的平方
比如 用3个数
那么要找3个数满足 这三个数小于等于（3+1）*（3+1) 且倒数之和为1

思路：
一个倒数可以分解问2个数的倒数之和
1/n= 1/(a*b)=1/a*(a+b) + 1/b*(a+b)

故 在已知 上层的情况下 可以直接将上一层的数分解为2个数  以此类推即可

手算  我没有写程序
#include<stdio.h>
int main()
{

printf("2 3 6\n");
printf("2 4 6 12\n");
printf("2 5 6 12 20\n");
printf("2 5 7 12 20 42\n");
printf("3 5 6 7 12 20 42\n");
printf("3 5 6 8 12 20 42 56\n");
printf("3 5 6 8 16 20 42 48 56\n");
printf("3 5 6 12 16 20 24 42 48 56\n");
printf("3 5 6 16 20 21 24 28 42 48 56\n");
printf("3 5 6 16 21 24 28 36 42 45 48 56\n");
printf("3 5 6 16 24 28 30 36 42 45 48 56 70\n");
printf("3 5 6 16 28 30 33 36 42 45 48 56 70 88\n");
printf("3 5 6 16 28 33 36 39 42 45 48 56 70 88 130\n");
printf("3 5 6 16 33 36 39 42 44 45 48 56 70 77 88 130\n");
printf("3 5 6 20 33 36 39 42 44 45 48 56 70 77 80 88 130\n");
printf("3 5 6 24 33 36 39 42 44 45 48 56 70 77 80 88 120 130\n");

return 0;
}


展开全文
• 今天使用Python的sklearn模块训练模型时，报错ValueError: The number of classes has to be greater than one; got 1 class，如下： clf.fit(x,y) ->ValueError: The number of classes has to be greater than ...
• 运行sklearn.svm函数预测时，报错 ValueError: The number of classes has to be greater than one; got 1 class 找到报错原因了，因为y只有一种可能的值，1. 接下来，是要找到为什么y的赋值只有1. —— —— —— ...
• In each case there are R (R ) rounds of the game, R is an odd number to guarantee that there must be a winner in the end. In each round: There is a pile of n (10 ) Special-cards and m (1 ) piles of ...
• In each case there are R (R ) rounds of the game, R is an odd number to guarantee that there must be a winner in the end. In each round: There is a pile of n (10 ) Special-cards and m (1 ) piles of...
• Leetcode Number of Digit One ，本算法主要使用递归的方法完成问题解决，相关代码及测试如下：#include<iostream>/* * We use the recursive algorithm to solve this proble. We can conclued that * the number...
• One option is to be able to pass max number of pods for gpu access when plugin start, then plugin will report that number of devices to kubelet service, which could server more pods for gpu access....
• The particular L . a . Healing Pot System will be the one that provides tremendously extended within the last several decades. Since a growing number of medical doctors grow to be section of this
• Number one: Don't multitask.//三心二意 　Be present , Be that moment. Number two: Don't pontificate.//好为人师 　The true listening requires a setting aside of oneself. Assume that you have ...
• Can animals be made to work for us... Some scientists think that one day animals may be taught to do a number of simple jobs. They say that in a film or on TV, we may see elephants or monkeys, dogs, bea
• The first line contains an integer n, which is the number of cases to be tested, followed by n lines, one integer 1 ^7 on each line. Output The output contains the number of digits in the factorial ...
• Of course, there might be an infinite number of choices for a player, so it may not be easy to find the best move among these possibilities. But after playing for some time, the number of remaining ...
• Description A single positive integer i is given....There should be one output line per test case containing the digit located in the position i. Sample Input 2 8 3 Sample Output 2 2
• Type I is to connect two number grids with different parities (i.e., connect odd number with any other even number). It might be hard to cover the entire grid with only type I path, so we allow type ...
• System.Text.Json不会自动把json中的字符串... public int NumberOne { get; set; } public int NumberTwo { get; set; } } var options = new JsonSerializerOptions { NumberHandling = JsonNumberHandling.All
• Description ...For example, if you are asked to list the triangular-hexagonal-leap years from 780 to 2556, the output should be: 780 1128 1540 2016 2556 Sample Output 2016 2556 ... 990528
• If Xiao Ming choose to write down a number, there will be an " I" followed by a number that Xiao Ming will write down. If Xiao Ming choose to ask Xiao Bao, there will be a "Q", then you need to ...
• The height of each slot may be any one of the 4 values in｛1,2,3,4｝( neglect unit ). Among the slots of a lock there are at least one pair of neighboring slots with their difference of height equal ...
• Here is your problem: given a starting number, and assuming both players play to maximise their own points, what will be the outcome? Input On the first line of the input is a single positive ...
• Because of the popularity of the one-person game show “Who Wants to be a Millionaire”,the American Contest Management (ACM) would like to introduce a one-person version of the “The Price is Right...
• A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string "13" and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 ...

...