Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
When should I output the sign? | Vinicius Fortuna | 1074. Очень короткая задача | 31 авг 2008 16:46 | 2 |
The problem statement says that the sample input -0.051e0 1 gives 0.0 as output, and not -0.0 Is that right or the sample is wrong? If it was -0.051e0 2 what should I output? -0.05 or 0.05? Thanks a lot Vinicius Fortuna IC-Unicamp You should output '-' sign when original number is negative and output contains at least one non-zero digit. |
HELP ME! | Dembel {AESC USU} | 1074. Очень короткая задача | 30 май 2008 18:39 | 5 |
HELP ME! Dembel {AESC USU} 21 дек 2006 19:27 what output for input <empty line> 1 # ??? Looks like "Not a floating point number" HELP ME! Dembel {AESC USU} 22 дек 2006 13:36 I don't know why have WA#12. Please give me some tests. Thanks. Re: HELP ME! [SPbSU ITMO] Kazakov Sergey (CK.) 20 апр 2008 02:02 |
tricky test | Oracle | 1074. Очень короткая задача | 27 мар 2008 00:57 | 1 |
1e-10000000000000000000000000 5 right output is 0.00000 It helped me with WA12 |
How to input it? Pascal | gyz113 | 1074. Очень короткая задача | 12 фев 2008 11:26 | 3 |
If you're going to read strings then use 'readln' to skip #13 and #10 characters. If you use 'read' then the next reads will get empty strings. |
Wrong answer on test #2 | Luft-on | 1074. Очень короткая задача | 6 окт 2007 21:41 | 2 |
Am I so stupid? I have WA on 2-nd test, help! What it can be? I had too and then it appeard that the problem was in such inputs 12.e10 (which is NOT a floating point) also consider -.e10 (which is NOT a floating point either) (there should be something after the DOT if it exists) |
string.h | asd | 1074. Очень короткая задача | 16 авг 2007 20:33 | 2 |
Can I use any functions from string.h? I've got Compile Error and can't understand where is the problem? (I suspect string functions) How can I find out where is the problem? |
I got WA on test 12, but I pass all test in discuss? | tantian | 1074. Очень короткая задача | 12 авг 2007 09:18 | 2 |
Could anyone help me? Please send the test 12 to my email. ttxxli@163.com |
test 12 hint | dgorlov | 1074. Очень короткая задача | 6 авг 2007 16:54 | 2 |
strings in input can contain '#' as 1 symbol and some characters else you should write "Not a floating point number" for these strings not terminate you program last string contains SINGLE char '#' |
Test 12... it is smth horrible | Burunduk1 | 1074. Очень короткая задача | 5 янв 2007 17:04 | 6 |
Please, give me ANY hint... My program passes (IMHO) all extremal tests (and, of course, all from previous posts) If you help me to pass this f%^&*$# 1st test from 1257, I'll show you, where your mistake. azrail@hotbox.ru P.S. Proposal works for all ^_^. Edited by author 25.12.2006 10:52 Edited by author 25.12.2006 10:54 I had problems with this test too, and just have understood, that my program don't work. =) As i remember, i've AC it, when analyzed cases with E : 1e+0000000000000000000000001 (ans - 1) or 100e-100000000000000000000000 (ans - 0) or 0e100000000000000000 (ans - 0) - you may skip this test, my program failed it =) Edited by author 04.01.2007 23:36 Thank you! But: >> 1e+0000000000000000000000001 (ans - 1) Why not 10? 1*10^0000000000000000000000001 = 1*10^1 = 10 Oh, nevermind =) try this one - 100e-00000000000000. i suggest you to look at your real number checking. i just added code in my program to pass number like "100." and it got WA12 =) if you want, i'll post right number-cheking function Edited by author 05.01.2007 17:05 |
I have got WrongAnswer at case 12 of 1074,could anyone help me? | 0 | 1074. Очень короткая задача | 1 дек 2006 09:19 | 1 |
|
2 Jury | Kopeliovitch Sergey (1) | 1074. Очень короткая задача | 12 авг 2006 13:00 | 3 |
2 Jury Kopeliovitch Sergey (1) 30 июл 2004 21:29 Tests: 10. 1 10.0e 1 10.e 1 Right answers: Not a floating point number Not a floating point number Not a floating point number My program results: 10.0 10.0 10.0 But I have AC. It's strange. If that's true, when I know, why I have WA! According to their notation these numbers are not correct at all!! To jury: is that still so? Give some comments to competitors |
Problem 1074 "A very short problem" has been rejudged (+) | Vladimir Yakovlev (USU) | 1074. Очень короткая задача | 3 авг 2006 23:27 | 2 |
A new tricky test was added. Thanks to Andrei Ustinov for help. Problem has been rejudged, only 20 of 411 accepted solutions have kept its status. Test 9 was incorect. Test was fixed, problem rejudged again, 42 verdicts were changed, but no one got AC anyway. |
I've got OL#9. What it may mean? | Fly [Yaroslavl_SU] | 1074. Очень короткая задача | 29 сен 2005 22:32 | 2 |
I've got OL#9. What it may mean? Output Limit Exceeded means your program outputs, outputs, outputs... So there is something like infinite loop in your program. |
my solve | Ариец | 1074. Очень короткая задача | 14 апр 2005 09:47 | 2 |
<...> Edited by author 24.10.2006 19:24 Edited by author 14.04.2005 09:52 |
I've got WA on 5'th test, can anybody give me some hints or tests, please! | cold_Iron | 1074. Очень короткая задача | 13 апр 2005 23:12 | 3 |
Here's my program: program p1074; {$APPTYPE CONSOLE} uses SysUtils; var Token, s: string; dlina_s, N, ukaz: integer; procedure GetToken; begin Inc(ukaz); if ukaz>dlina_s then Token:='' else Token:=s[ukaz]; end; procedure SendBack; begin Dec(ukaz); if ukaz=0 then Token:='' else Token:=s[ukaz]; end; function UnsInt:boolean; begin Result:=true; GetToken; if not (Token[1] in ['0'..'9']) then begin Result:=false; exit; end; while Token[1] in ['0'..'9'] do begin GetToken; if token='' then break; end; SendBack; end; function Znak:boolean; begin GetToken; if (Token='+') or (Token='-') then Result:=true else Result:=false; end; function _Int:boolean; begin if not Znak then SendBack; Result:=UnsInt; end; function Exponenta:boolean; begin GetToken; if (Token<>'e') and (Token<>'E') then begin Result:=false; exit; end; Result:=_Int; end; function UnsReal:boolean; begin GetToken; if Token='.' then // aa?eaio .x begin Result:=UnsInt; exit; end else Sendback; Result:=UnsInt; if not Result then exit; // aa?eaio x GetToken; if Token='.' then Result:=UnsInt // aa?eaio x.x else begin SendBack; exit end; end; function SimpleReal:boolean; begin if not Znak then SendBack; Result:=UnsReal; end; function RealNum:boolean; begin Result:=SimpleReal; if not Result then Exit; GetToken; if Token='' then exit else begin SendBack; Result:=Exponenta; end; end; function Analiz:boolean; begin Result:=RealNum; ukaz:=0; end; // ------------------ Eiiao aiaeeca --------------------- // procedure DelExp(col: integer); var i, j, dot: integer; zeros: string; begin zeros:=''; i:=StrToInt(copy(s,col+1,dlina_s)); // noaiaiu e Delete(s,col,dlina_s); dot:=Pos('.',s); if dot=0 then begin for j:=1 to abs(i) do zeros:=zeros+'0'; if i>=0 then s:=s+zeros else s:=zeros+'.'+s; end else begin if i=0 then exit; if i>0 then begin if i>=length(s)-dot then // noaiaiu e aieuoa aeeiu a?iaiie ?anoe, iiyoiio begin // aueeauaaai oi?eo e aiiieiyai ni?aaa ioeyie for j:=1 to i-length(s)+dot do zeros:=zeros+'0'; s:=s+zeros; Delete(s,dot,1); end else // noaiaiu e iaiuoa aeeiu a?iaiie ?anoe, ia?aaaeaaai oi?eo ia i ai?aai begin Insert('.',s,dot+i); Delete(s,dot,1); end end // if i>0 else begin if abs(i)>=dot-1 then // noaiaiu e (ii iiaoe?) aieuoa aeeiu oaeie ?anoe ?enea begin // ia?aaaeaaai oi?eo ia io?iia ianoi e aiiieiyai ioeyie neaaa Delete(s,dot,1); for j:=1 to abs(i)-dot+2 do if j=1 then zeros:='0.' else zeros:=zeros+'0'; Insert(zeros,s,1+Ord(s[1]='-')); end else begin Delete(s,dot,1); Insert('.',s,dot+i); end; end; end; end; procedure Format; var i, dot, count: integer; begin if s[1]='+' then Delete(s,1,1); // oaaeyai ie?n // oaaeyai aaaouea ioee count:=0; for i:=1 + Ord((s[1]='+') or (s[1]='-')) to length(s)-1 do if s[i]='0' then begin if s[i+1]<>'.' then Inc(count) end else break; if count>0 then Delete(s,1+Ord((s[1]='+') or (s[1]='-')),count); // oaaeeee ioee i:=Pos('e',s); if i<>0 then DelExp(i) else begin i:=Pos('E',s); if i<>0 then DelExp(i); end; // ieoai 0 a oaeie ?anoe if ((s[1]='-') and (s[2]='.')) or (s[1]='.') then Insert('0',s,1+Ord(s[1]='-')); dot:=Pos('.',s); if (N=0) and (dot<>0) then Delete(s,dot,length(s)); if (N>0) and (dot<>0) then if N>length(s)-dot then for i:=1 to N-length(s)+dot do s:=s+'0' else Delete(s,dot+N+1,length(s)); if (N>0) and (dot=0) then begin s:=s+'.'; for i:=1 to N do s:=s+'0'; end; if s='-0.0' then s:='0.0'; writeln(s); end; begin ukaz:=0; {Assign(Input,'input.txt'); Assign(Output,'output.txt');} repeat readln(s); if s='#' then break; readln(N); dlina_s:=length(s); if not Analiz then begin writeln('Not a floating point number'); continue; end else Format; until false; end. |
I got WA(1074)?Can you give me some tests? | Saturn | 1074. Очень короткая задача | 15 июл 2004 20:17 | 2 |
|
could you have a look? | testing~ | 1074. Очень короткая задача | 29 мар 2004 19:59 | 1 |
this is my code who can give me some data? thanks !
program A_very_short_problem ; const nono = 'Not a floating point number'; var s : ansistring; jj,j1 : boolean; i,j,k,l,jin : integer; function ok(q,h : integer) : boolean ; var i : integer; begin ok:=false; for i:=q to h do if s[i] in ['0'..'9'] then else exit; ok:=true; end; begin // assign(input,'pp.txt'); reset(input); readln(s); while s<>'#' do begin j:=pos('e',s); l:=length(s); if j=0 then j:=pos('E',s); if (j<>0)and(j<l) then if ok(j+2,l)and(s[j+1] in ['0'..'9','+','-'])and ((j<l-1)or(s[j+1] in ['0'..'9'])) then begin jin:=0; i:=j+1; if s[i]='-' then jj:=false else begin jj:=true; if s[i]<>'+' then jin:=ord(s[i])-48; end; while i<l do begin inc(i); jin:=jin*10+ord(s[i])-48; end; end else begin writeln(nono); readln(j); readln(s); continue; end else j:=l+1; delete(s,j,l-j+1); l:=j-1; if l=0 then begin writeln(nono); readln(j); readln(s); continue; end; k:=pos('.',s); if ((k=1)or(s[1] in ['0'..'9','-','+']))and ok(2,k-1)and ok(k+1,l)and(k<l) then else begin writeln(nono); readln(j); readln(s); continue; end; if s[1] in ['+','-'] then begin if s[1]='-' then j1:=true else j1:=false; delete(s,1,1); end else j1:=false; k:=pos('.',s); l:=length(s); if k=0 then k:=l+1 else begin delete(s,k,1); dec(l); end; if jj then inc(k,jin) else dec(k,jin); while k<=0 do begin s:='0'+s; inc(k); end; while k>l+1 do begin s:=s+'0'; inc(l); end; if k=1 then s:='0.'+s else if k=l+1 then s:=s+'.0' else insert('.',s,k); while s[1]='0' do delete(s,1,1); if s[1]='.' then s:='0'+s; l:=length(s); k:=pos('.',s); readln(j); for i:=1 to k+j do if (i<>k)and(i<=l) then if s[i]<>'0' then begin i:=-1; break; end else else break; if i=-1 then if j1 then write('-'); for i:=1 to k-1 do write(s[i]); if j>0 then write(s[k]); for i:=k+1 to k+j do if i<=l then write(s[i]) else write('0'); writeln; readln(s); end; end. |
Is answer -0.0 correct for input S='-0.051e0', N = 1??? According to specification '-0.0' is a <simple real number>. | Vlad Veselov | 1074. Очень короткая задача | 5 июн 2003 19:09 | 1 |
|
Is '1.1 ' a valid real number (there is a space after '1.1') | Kolio | 1074. Очень короткая задача | 25 апр 2003 19:16 | 2 |
|
Could I know the e-mail of the author of this problem. I have WAed over 20 times. | Safe Bird (USU) | 1074. Очень короткая задача | 4 янв 2003 09:13 | 3 |
|