Show all threads Hide all threads Show all messages Hide all messages |
9 = IX also 9 = VIV | monyura[ONU 1 2/3] | 1262. Pseudo-Roman Number | 20 Oct 2017 22:49 | 2 |
The nine has two representation according to to these rules, am I wrong? Yes, you are, look at the 5th rule. |
Wrong #11 example | Nodirbek Islomov | 1262. Pseudo-Roman Number | 8 Jan 2015 01:25 | 1 |
8888 --> 16 Edited by author 08.01.2015 10:09 Edited by author 08.01.2015 10:09 |
very interesting!! there 2 code | Bobur | 1262. Pseudo-Roman Number | 23 Oct 2010 19:03 | 4 |
var s : integer; ch : char; begin s := 0; while not eof do begin read(ch); case ch of '1', '5' : inc(s); '2', '4', '6', '9' : inc(s, 2); '3', '7' : inc(s, 3); '8' : inc(s, 4); end; end; writeLn(s); end. this ic gave me AC!! var s : integer; ch : char; a : array ['0'..'9'] of byte = (0, 1, 2, 3, 2, 1, 2, 3, 4, 2); begin s := 0; while not eof do begin read(ch); s := s + a[ch]; end; writeLn(s); end. and this WA#1!!!! i don't know why, who can explain it to me!! thanks!! i don't know what it mean in pascal, but in C it is "address to non-existent element of memory" take one correction: read(ch); //insert here: if ((ch<'0') or (ch>'9')) then break; s := s + a[ch]; ..... and sorry for my bad english Edited by author 08.12.2008 22:11 this is my program: const a:array['0'..'9'] of longint=(0,1,2,3,2,1,2,3,4,2); var k:char; s:longint; begin s:=0; while not EOln do begin read(k); inc(s,a[k]); end; write(s); end. use longint, not byte;) But can you tell me the reason using Longint excepted byte? thankx |
Strange judgement result. | Fokysnik[LNU] | 1262. Pseudo-Roman Number | 10 Feb 2007 10:52 | 2 |
First, I wrote a program on C++ like this: #include<stdio.h> void main(void) {char c; int t,s=0; while (!feof()) {scanf("%c",&c); ... } ... printf("%i\n",s); } Judgement result: Wrong answer #1 After that I wrote same program on Pascal like this: program roman; var c:char; t,s: integer; begin s:=0; while not eof() do begin read(c); ... end; ... writeln(s); end. Program on Pascal got AC. Those "..." are both correct I tested both programs on my own on the keyboard and using freopen. Does anybody know why C++ gets WA and Pascal AC? Edited by author 09.02.2007 21:21 |
AC(+) | Yu Yuanming | 1262. Pseudo-Roman Number | 16 Jun 2006 14:36 | 10 |
AC(+) Yu Yuanming 11 Jun 2005 21:30 At first I think this problem is difficult, so I am surprised why so many people got AC... I look at small case, and general it just for a try, it got AC! the pro is very short...faint... Re: AC(+) I am get tester... 12 Oct 2005 16:54 I don't know why all think than that problem is difficult. I spent for it 10 minutes Re: AC(+) Нараевский Женя (Хмельницкий) 12 Oct 2005 19:46 Yu Yuanming please help me! Can you send your AC on my e-mail naraevsky@rambler.ru!!! Please Re: AC(+) Dzhulgakov Dmitry 15 Jun 2006 20:51 I agree with you. This problem is so easy!!! My AC solution size is 4 code lines :) Damn, but how to do it?.. Each digit has itself code. You have to determine summary code's length. Just write some numbers manually... It's very easy to understand the decision. So, I should try it in small numbers, then I'll see the decesion and the task will be solved? I looks like so difficult... Write a program which converts decimal numbers to roman. You will see ;) "I had nothing to say and i get lost in the nothingness inside of me..." Linkin Park says true. Oh, God! AC! I didn't expect me to solve this problem! Thank U! |
Some clarifications | Michael Rybak (accepted@ukr.net) | 1262. Pseudo-Roman Number | 3 Feb 2006 21:42 | 1 |
*** rule 1 is REALLY IMPORTANT. It means we have an infinite number of letters, not only I .. M, which means we can represent as large numbers as we wish to The rest below is just for the sake of being pedantic enough :) *** rule 2 is incorrect about non-powers-of-10. There can be 3 or less identical symbols (in a row) if they denote 10^k, and no identical symbols otherwise, not 2. *** rule 5 actually says: Ai >= Ai+2, and Ai+1 can be anything, but if it's larger than Ai, then Ai > Ai+2, not >= *** rule 4 means that for some i there can only be a signle j that j < i and Aj < Ai (another interpretation is that there can be no 2 smaller numerals *immediately* before some numeral, which in fact implies from rule 5) Edited by author 03.02.2006 21:42 Edited by author 03.02.2006 21:43 |
right output on '440' | Sni | 1262. Pseudo-Roman Number | 31 Dec 2005 20:59 | 2 |
plz hlp with '440' right answer is 4 or which yes it 4. Test for you 1234567891011121314151617181920 Answer 52. Maybe it Help. |
I think that something is wrong in this problem... | Bandera | 1262. Pseudo-Roman Number | 1 Apr 2005 20:21 | 4 |
If n=20000 i think that are no psevdo-roman number to represent n. What i have print in this case? May be 0? Edited by author 01.04.2005 19:42 Why there is no such number? My AC solution works right in this case. Than please write answer of your problem if n=20000. Why there is no such number? My AC solution works right in this case. |
why i get WA in test #11 ? | Stanica Andrei | 1262. Pseudo-Roman Number | 8 Sep 2004 23:23 | 6 |
I can also say, that it is the first test in which N has more than 1000 digits ... I think 10000 = MMMMMMMMMM So I output 10... Is this right? No, you are wrong. The answer is 1, because all the numbers 10^k and 5*10^k are written in Pseudo-Romanian system with only 1 (maybe very unusual) digit. |