0

Please help me with this solution.

This question is asked in a coding plateform. https://toph.co/arena?contest=coderace-august-2021#!/p/61253756eeac597b2578c70f but my solution was not accepted in case 3. Whats wrong in my code?? Can anyone help me? https://code.sololearn.com/cr1qyzCD85nA/?ref=app

25th Aug 2021, 10:14 AM
Anikur Rahman
Anikur Rahman - avatar
5 Antworten
+ 1
j should be a long long int Anyway, you should copy-paste the problem text if you want more help
25th Aug 2021, 3:50 PM
Angelo
Angelo - avatar
0
Kodu’s friend Modhu gave him the following formula to generate a series. Modhu asked him if Kodu could find the AverageAverage of first {P}P numbers of the series. {N^{th} number = N^3(\frac{9N-3}{6N^2})} N th number=N 3 ( 6N 2 9N−3 ​ ) Input First line of input contains an integer number {T}T {(1≤ T ≤10^5)}(1≤T≤10 5 ) (number of queries). Each of the next {T }T lines contains an integer PP{(1 ≤ P ≤ 10^5})(1≤P≤10 5 ). Output Print TT lines of integers. The i^{th}i th line contains the answer of the i^{th}i th query.
25th Aug 2021, 4:30 PM
Anikur Rahman
Anikur Rahman - avatar
0
It is the question
25th Aug 2021, 4:30 PM
Anikur Rahman
Anikur Rahman - avatar
0
Ok, I don't buy you thought that was readable! Anyway, N^3(9N-3) is not in the range of a long long: simplify the expression! 10^5 is well in the range of an int: don't waste space long long int main??? No! (also return 0;)
25th Aug 2021, 5:17 PM
Angelo
Angelo - avatar
0
Angelo That was my problem I saw its giving cpu limite exceeded
25th Aug 2021, 5:34 PM
Anikur Rahman
Anikur Rahman - avatar