Home > Back-end >  To solve the
To solve the

Time:01-06

Give you two arrays, choose a number from the first array x, choose a number from the second array y, ask you how many set of y/x has a value of k
Enter the first line is an integer T, then have group T test data
For each set of test data, the first line of input two Numbers n and k
The next input number n, representing the value of the first array
The next input number n, representing the value of the second array
1<=T<=10, 1 & lt;=n<=1000, 1 & lt;=k<=10000, 1 & lt; [I]=(a, b [I] <=1000000
#include
Int main ()
{
Int I, j, kh [1000], yh [1000], T, n, k, sum=0;
The scanf (" % d ", & amp; T);
While (T -)
{
The scanf (" % d % d ", & amp; N, & amp; K);
for(i=1; i<=n; I++)
The scanf (" % d ", & amp; Kh [I]);
For (j=1; J<=n; J++)
The scanf (" % d ", & amp; Yh [j]);
for(i=1; i<=n; I++)
{
For (j=1; J<=n; J++)
{
If (yh [j]/kh [I]==k)
{
sum++;
}
}
}
}
Printf (" % d ", sum);
}


Why wrong???????????

CodePudding user response:

Yes, why?
The key is, what is wrong?
Who said was wrong?
How do you say?
Say what?
Do nothing without enough information, a program also can saying is right:
Int main () {}

CodePudding user response:

Computer judgment mechanism, solve the above problem, when I write code to give me as a result of the wrong answer,
Give you two arrays, choose a number from the first array x, choose a number from the second array y, ask you how many set of y/x has a value of k
Enter the first line is an integer T, then have group T test data
For each set of test data, the first line of input two Numbers n and k
The next input number n, representing the value of the first array
The next input number n, representing the value of the second array
1<=T<=10, 1 & lt;=n<=1000, 1 & lt;=k<=10000, 1 & lt; [I]=(a, b [I] <=1000000
This is the problem,,,

CodePudding user response:

Aliquot required because of who you are, and will directly deduct the result not
Such as 1.5 l=1, not in the computer

CodePudding user response:

OJ, so the main problem is that you didn't read the necessary instructions, even the title is not complete, the complete title is including input and output format and example,
Most strict OJ output formats, and you don't express subject to the requirement of the output format, big probability is no attention,
Most demanding OJ main function returns 0 to the operating system to express their end is normal, and your main function does not,
  • Related