|
|
The description of the problem says: "Your program must take into account the command \", which is used to write two dots above a vowel. For example, \"e means the symbol ë." But you don't really have to distinguish between vowels and consonants for this command. Edited by author 26.08.2024 17:37 You are amazingly attentive! I solved the problem on the first try simply because I didn't even think about this detail of the task) I run out of ideas, trying to pass test #5. Does anyone can tell me how this test looks like? Thank you, There seem to be some non-ASCII characters in the test cases. If the input is loaded byte by byte, then the result should be output byte by byte as well. I used Rust and handled the bytes as chars, which were stored as 4-byte unicode, but mistakenly output the result by chars instead of bytes. My Accepted solution 8202681 for problem 1050 gives incorrect answer on my test (test contains command '\endinputany' in the middle of text). Please add my test to test package. TEST: There is no "q in this sentence. \par "Talk child," said the unicorn. \endinputany She s\"aid, "\thinspace `Enough!', he said." \endinput INCORRECT ANSWER: There is no q in this sentence. \par ``Talk child,'' said the unicorn. \endinputany CORRECT ANSWER: There is no q in this sentence. \par ``Talk child,'' said the unicorn. \endinputany She s\"aid, ``\thinspace `Enough!', he said.'' \endinput Hi "Paragraph ends in the source text are marked either by at least one blank line, or a \par command or both." What is the blank line? '\n'? Or some space symbol which ends with '\n'? Edited by author 13.08.2016 00:25 Edited by author 13.08.2016 00:26 Blank line is the 3rd line in example input, no spaces or other symbols. I suppose you're confused by looking at the input after highlighting it, but there are really no spaces there, it's just highlighting works that way. But how can I detect it in C++? I tried '\n', '\r' and "\n\r\r" but i have WA#3 :( I had WA3 because i forgot that after \endinput (not only after \par or blank line) i should check if there's an extra quote to be removed in that paragraph. Maybe that will help you. As about your question, i'm not really good at C++, but maybe i can suggest http://linux.die.net/man/3/getline or something. And if that line is of length 0, then it's blank. Memory limit test 1. C++. using: vector<string> str str[i].erase() str[i].insert() using erace and insert it creats another string object. I know, so how can i insert '' or `` instead of " ? Input: abcd\" \endinput Output: abcd\" \endinput Give me some tests or advices, please. Got WA4, cause ignore situation \par" Input: There is no "q in this sentence. \par" "Talk child," said the unicorn. She s\"aid, "\thinspace `Enough!', he said." \endinput Output: There is no q in this sentence. \par`` ''Talk child, said the unicorn. She s\"aid, ``\thinspace `Enough!', he said.'' \endinput Input: "Hello world "Next paragraph" and this works " \par last one \endinput Output: Hello world ``Next paragraph'' and this works \par last one \endinput I tried to read data string by string and then by characters but in both cases I got Crash(access violation) on 1st test :( Edited by author 10.06.2004 19:31 post your mail, I have all tests Could you post to me ? My e-mail : FlyMU@hotmail.com I received the tests . Thank you very much !!! Edited by author 12.06.2004 23:27 Could someone send me the tests, too? My email is dporobic@eunet.yu. Thanks in advance, all the best, Danica maigoakisame@yahoo.com.cn Can you give me these test?I got WA quangviet2004@yahoo.com I got Ac now Give me tests on this problem please. i'm getting WA on 6th test. dr@hotmail.kz Could you give me? failedpeter.student@sina.com 3x~ This adress doesn't work: timustests.4t.com Could you please give me the tests ? My email : alexpopa9@gmail.com. Thank you very much ! yuxin200488@hotmail.com thanks Please, post it to me too... I want to find out my mistake... _magistr.90@mail.ru There is "_" before magistr. Thanks a lot! send me this tests please forensic@rambler.ru Please send these tests to me !thanks! ysymyth@gmail.com 1. \par marks end of paragraph, but \\par is not (it is command \\ followed by word `par'). 2. Carefully calculate number of backslashes (\). \\"" gives \\``'', but \\\"" gives \\\" \\ command is not described in the task, only \" is example: \""\para\"" what's right output? And how about the following input: \""\para\"" \endinputpar \endinput" \endinput What about: "\p ar" \endiput I cannot understand the question at all... corrected example: \""\para\"" \endinput correct output: \"``\para\"'' \endinput thus \para is just some other TeX command and you should not care what it does. in this test all text contained in one paragraph. It is possible to get AC with a 10-lines program. Simply use regular expressions: Q = "(?<!\\\\)\"" for " which is not preceded by \ ".*?(?:\n\r?\n|\\\\par(?![A-Za-z])|$)" for paragraph (note \r) For each paragraph you get with Scanner.findWithinHorizon, do replaceAll matching Q+"(.*?)"+Q with "``$1''" and then replaceFirst Q with an empty string. Btw, the real TeX parsing is much more complicated, e.g., \\par would not end a paragraph. I passed test 3 after replacing my "blank line" regexp "\n\n" with "\n\r?\n". Apparently "blank" (which used to mean "empty") here means empty or "\r". Is there any good tests? Don't forget that \endinput is end of paragraph too. is sequence of two slash symbols is a command? For example: \\"" \endinput What is right output? \\" or not? The right output is \\" \endinput My AC program output: //``'' /endinput If you want ACC fast, don't use "super-extra-hiper-shmiper smart" solution. Very silly and small one works well(not very fast though). |
|
|