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

#include <iostream.h>

int main()
  {
   unsigned int n,m;      //when this is long i get WA
   cin>>n>>m;
   if (n<=m) cout<<2*(n-1); else cout<<2*m-1;
   return 0;
  }
But why do you think tha's strange? You write 2*(n-1) in your code,
thus, since n<2^31, 2*(n-1) could be close to 2^32, and you are to
use unsigned.