Just a simple sumProblem code: H4 |
All submissions for this problem are available.
Given n and m, calculate 11 + 22 + 33 + ... + nn modulo m.
Input
The first line contains 1 ? t ? 10, the number of test cases. Then the test case definitions follow. Each test case is of the form: 1 ? n ? 1018, 1 ? m ? 200000
Output
For each test case simply write a single line containing the answer to the problem.
Example
Input: 6 1 100000 2 100000 3 100000 4 100000 5 100000 6 100000 Output: 1 5 32 288 3413 50069
| Author: | admin |
| Date Added: | 15-09-2009 |
| Time Limit: | 10 - 80 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

Sorry for the last post. I
Sorry for the last post. I misuse this tool. I just want to submit the code. For admin, could you please delete the previous post? I do sorry about that.
After submitting, it is
After submitting, it is taking unusually long to show the result... Is anything wrong?
The time limit for this
The time limit for this problem is 80 seconds. :)
My program's working
My program's working perfectly in Dev C++..but on submitting a runtime error occurs...why??!!!! T_T :(
Itested the sample inputs on
Itested the sample inputs on my program. Its perfectly displaying the output as intended. But still it shows wrong answer. Is there anything else that I have to check?
Please read the FAQ and
Please read the FAQ and www.codechef.com/wiki
I believe something is wrong
I believe something is wrong with the test data.
I too think there is
I too think there is something wrong with the test data. Can the admins confirm the sanctity of the testset
I may very well be wrong, but
I may very well be wrong, but I agree with Neil and Balakrishnan -- something seems amiss with the program checker/testcases.
But then again, one person _has_ managed to solve the problem....
I also agree with Neal,
I also agree with Neal, Balakrishnan and Ashutosh, there is something wrong with the testcases.
We are checking the test
We are checking the test data. Will post an update here as soon as we reach a conclusion :)
IS IOSTREAM.H NOT INCLUDED IN
Please take a look at FAQ and
Please take a look at FAQ and Sample Solutions
IN SAMPLE SOLUTION THEY HAVE
IN SAMPLE SOLUTION THEY HAVE USED #INCLUDE<IOSTREAM> , SHOULDN'T IT BE <IOSTREAM.H>. BECAUSE MY COMPILER SAY'S FORMER IS WRONG.
ALSO CANT I USE MATH.H?
ALSO CANT I USE MATH.H?
The compiler we use is
The compiler we use is mentioned in the FAQ and on www.codechef.com/wiki. Probably the compiler you are using does not comply with the c++ standards.
"We are checking the test
"We are checking the test data. Will post an update here as soon as we reach a conclusion "
is test data right?
I can't comment on that yet
I can't comment on that yet :)
This is not good here my
This is not good here my program is running but in ur simluation it's giving compile error....
i'm fed up now
Please check out the FAQ and
Please check out the FAQ and www.codechef.com/wiki
Any update on the
"We are checking the test data. Will post an update here as soon as we reach a conclusion "
is test data right?
Can you provide the test
Can you provide the test cases so we can run on our own before submitting. please provide output as well.
Of course not, then you could
Of course not, then you could just submit hardcoded output.. you have to solve the problem by yourself without any help.
I reviewed some solutions
I reviewed some solutions (especially ACRush's) and my solution. Well, shame on you, I still claim testcases are correct.
but I'm still reviewing
but I'm still reviewing solutions and making extensive tests.
ha, found a bug, rejudge in
ha, found a bug, rejudge in progress (extremely specific bug..)
@Ashutosh Mehra The one
@Ashutosh Mehra
The one person simply reproduced my bug :>
Could you tell me how much
Could you tell me how much memory I can use for this or for that matter any problem in general at code chef?
Please read the FAQ
Please read the FAQ
it showing NZEC error what is
it showing NZEC error what is that?
@robinsingh: NZEC would mean
@robinsingh: NZEC would mean that your program is returning a non-zero value to the environment. In C programs, you should do a "return 0" from your main function. See the forum thread: http://discussed.codechef.com/showthread.php?t=34
The time limit seems to be
The time limit seems to be misleading to me. Are you saying our program should be able to handle just 10 test cases in 80 second? Or is the the program run multiple times with different set of inputs ?
Both are true. You should
Both are true. You should handle all 10 test cases in 80 seconds. There might be multiple test files each containing a maximum of 10 test cases.
pls give some discussion on
what is SIGARBT error
what is SIGARBT error
Please read the FAQ and
Please read the FAQ and www.codechef.com/wiki
on submitting i get runtime
I am able to solve data
I am able to solve data values like (N = 1o^18 , M= 199999) which should take max time, in nearly 10 s. But still I am getting TLE. Please help. I feel my algo is optimized already :(
The specs of the server might
The specs of the server might be different from those of your machine. Check out www.codechef.com/wiki for more information about the specifications of our servers.
my programm getting Runtime
my programm getting Runtime Error (NZEC).
m nt getting that how my program is returning a non-zero value to the environment.
admin can u plz help me.
hey guiz the input can be to
hey guiz the input can be to big as 10^18
how is the input given
to administrator input can be
to administrator
input can be to big as 10^18
how is the input given i mean wil they type 998746754345354363 like that
Yes.
Yes.
Is the time limit really 80
Is the time limit really 80 sec? My solution works locally in 0.5 seconds for the worst case (per test case), but I'm getting TLE.
Yes, the time is 80 seconds.
Yes, the time is 80 seconds.
when will the submissions for
when will the submissions for the problem will again get accepted.
Check
Check www.codechef.com/problems/H4
can i submit my code to this
can i submit my code to this prob now.......