Raem's Square

Raem is an eight years old boy. One day his family was visiting Dhaka Shishu Park near Shahbag. Besi…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

Wait is this problem’s test case 100% ok!!!

beacause I have just made an algorithm by pow(num,2) and it generated WA!!!
Where it can’t even be WA at all!!!

I have checked your submission. Test cases are okay. You have to read the problem statement carefully.

Man! we have to just find out the square of a certain number which basically means pow(n,2)…whats the problem then!

@Being_Gorom Sorry about that. Apparently, this problem statement wasn’t written properly. Please check the input specification now.

If you would explain it(i.e. this problem) correctly that would be much helpful since I can’t understand this…

image

Check your solution with this input:

1
1000000

Update the question statement please. It shows N <= 106 but it was supposed to be 10^6.

1 Like

Thank you for the feedback, @JarifDotTech.

Can you please share a screenshot of where you are seeing this?

This is what is currently published:

Screenshot_20220507-155528_Fennec

I should’ve mentioned… the problem is only in Bengali.
image

1 Like

Thank you! I should have checked that. Will update it shortly in sha Allah.

#include <stdio.h>
int main(){
    int t,n;
    unsigned long long int out;
    scanf("%d",&t);
    if(1<t && t<1000){
        while(t!=0){
            scanf("%d",&n);
            out=n*n;
            printf("%llu\n",out);
            t--;
        }
    }

}

please check my code and infor me what’s wrong

Even though you are multiplying the number and storing the result in a long long variable. Right when you multiply two integers, the result overflows.

Either change the type of n. Or, cast n to a larger type before multiplying.

1 Like