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 1209. 1, 10, 100, 1000...

Very simple solution HERE!
Posted by BlackShark 2 Jan 2009 14:32
const eps=0.000001;
var i,n:word; a,b:real;
begin
readln(n);
for i:=1 to n do begin
readln(b);
a:=(sqrt(8*b-7)-1)/2;
if (frac(a)<eps) or (frac(a)>1-eps) then write('1 ')
else write('0 ');
end;
end.
Re: Very simple solution HERE!
Posted by RobinGud 1 Feb 2017 01:17
Thank you very much!
Re: Very simple solution HERE!
Posted by HuyBui 18 Dec 2017 07:55
Can anyone explain how does it give the right answers?
Re: Very simple solution HERE!
Posted by Hafizur Rahman 14 Jun 2019 19:34
can you please explain the logic of the problem?