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

I got AC,here is my program
Posted by ufx 5 Apr 2003 08:17
please int64 type or dword  ,using longint is wrong.
otherwise you will get a over data
this is a math method
you can prove it,or practise some examples and you will find
the orderliness
I like these problems ,if you have please send to me.
my e-mail : zhuyin_222@hotmail.com
//
program ex;
var   a,b:int64;
begin
    readln(a,b);
    if a<=b then writeln(2*(a-1))
    else writeln(2*b-1);
end.