ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1224. Spiral

Wrong answer... help me.. plz
Posted by Vonni 29 Dec 2016 16:43
#include <stdio.h>
int main()
{
    int N, M;
    scanf("%d%d",&N,&M);
    long int res;
    if (N <= M)
        res = 2 * (N - 1);
    else
        res= 2 * (M - 1)+1;
    printf("\n%d",res);
    return 0;
}
Re: Wrong answer... help me.. plz
Posted by Zteeks 30 Dec 2016 04:02
Can't solve this promlem myself.
I run your code online on some tests, it seemed ok.
Check, maybe you go out of range in res? (know nothing about C)
Re: Wrong answer... help me.. plz