Home > Back-end >  To a big, ac but school OJ subject
To a big, ac but school OJ subject

Time:02-06

Topic is not difficult, basically will be, but is ac, however, don't know what the reason, submitted more than 200, it passed a



It is a school with the version of the compiler:

CodePudding user response:

This problem I have tried many times, the Internet also looking for the other's answer to the question, also had not

CodePudding user response:

Give your final code display, from the way which error is above,

CodePudding user response:

What is the hidden pit? Watching isn't difficult timeout can understand,,

CodePudding user response:

Topic should be capped, so broadly speaking positive integer always lets a person lack,

CodePudding user response:



This is my add figure, shows the wrong answer

CodePudding user response:

Here is my code:

#include
Int div (int x)
{
Int I, count;
For (I=1, the count=0; i<=x; I++)
{
If I==0) (x % count++;
}
return count;
}
Int main ()
{
Int a, b, I, flag=0, n);
The scanf (" % d % d ", & amp; A, & amp; b);
For (I=a; i<=b; I++)
{
N=div (I);
If (n> Flag, flag=n;
}
Printf (" % d \ n ", flag);
return 0;
}

CodePudding user response:

refer to the second floor forever74 response:
to show you the final code, from the way is this kind of error,


Has been sent to

CodePudding user response:

The same OJ on other topics for input and output, for example, have the explicit \ n?
This thing is not common,

CodePudding user response:

Some questions and some not, but it's not the problem, I tried

CodePudding user response:

For (I=1, the count=0; i<=x; I++) count from 1 to X efficiency of nature at a discount

CodePudding user response:

references to the tenth floor wise men know already should good karma response:
for (I=1, the count=0; i<=x; I++) count from 1 to X efficiency of natural discount

Despite the effort can be faster, but now he is ah WA, principal contradiction is not timeout,
I admit that skill is poor,

CodePudding user response:

references to the tenth floor wise men know already should good karma response:
for (I=1, the count=0; i<=x; I++) count from 1 to X efficiency of natural discount

Subject from a to b, here is 1 a

CodePudding user response:

Website need not the main function to solve the problem had deleted the main function

CodePudding user response:

Look from the screenshot there are a few mistakes, logic errors, operation error, timeouts, etc., the logic algorithm didn't clarify,
Can be caused by project quantity too much overtime, operational errors caused by algorithm logic is not clear, which in turn cause other problems,
A few simple o this is the basic mathematical knowledge, obviously not with ab initio calculations to end of the mathematics knowledge to use
To see a picture and see whether enlightenment,

CodePudding user response:

figure
  • Related