Show all threads Hide all threads Show all messages Hide all messages |
WA12 | Borozdin Kirill | 1027. D++ Again | 16 Sep 2022 16:18 | 2 |
WA12 Borozdin Kirill 2 Nov 2010 18:13 What can I do?.. My program passes all testes here, but still WA12... Any test cases? |
If you get WA10 | Ulugbek#& | 1027. D++ Again | 5 Oct 2021 14:34 | 2 |
I've got several times WA 10 and in the forum I couldn't find any test for this test, and finally I found where was the mistake. Try this: (* WTF?!! * ) answer is yes No! It's wrong. The asnwer is NO because the comment isn't closed. The comment should end by '*)', not '*\n)' |
What's the test 4?? | zylm | 1027. D++ Again | 14 Aug 2018 17:20 | 2 |
I use "string ch" AC,but " char ch[maxn]" WA4,I don't know why ..... You may be forgetting that C strings contain ONE more character that is called terminal character (or whatever). So it must be 10001. And it works! for me |
2 Admins: I probably found bad test for my AC solution | Khranovsky`~ | 1027. D++ Again | 14 Aug 2018 17:11 | 2 |
Test: ((**)*) My answer is YES, but if we delete comment (**) it will remain only (*) and it must be arithmetic expr, but it's not cuz arithmetic expressions can't start with (*, so the right answer is NO, am I wrong? You are wrong. There are no rules for comments if there are no comments. lol |
Helpful TEST CASES | Dmitry | 1027. D++ Again | 2 Dec 2017 02:48 | 2 |
Note*: if you have WA1 just skip all #10 and #13 symbols from input data! ((*Answer is YES*)) (((*Answer is YES*))) (**) YES (* NO (*) NO (*(*) YES (11(*)) NO (*(**)*) NO ((**)*)(**)*) NO! ((**)*) YES ()() (()) ((())) YES (1+1 ) YES THANK YOU very much for "(*(*) YES"! |
Why read text with std::getc got AC 0.001s and fread got AC 0.015s for C++ compilers ???? | c_pp | 1027. D++ Again | 15 Dec 2016 00:14 | 1 |
char s[16384] ; unsigned n = 0; // AC 0.001s with this code. for(int c = std::getc(stdin); c != EOF; c = std::getc(stdin)) s[n++] = c; // and AC 0.015s with n = fread(s,1,sizeof(s)-1,stdin); code. // I'm wonder that the std::getc faster than fread!! |
If you have WA #31 | Smilodon_am [Obninsk INPE] | 1027. D++ Again | 26 Sep 2016 18:01 | 2 |
|
should I print YES for the string (**)*) ? | thwomass | 1027. D++ Again | 24 Sep 2016 03:55 | 5 |
the problem says that comments may contain every symbol so, comments may contain *) so, should take the *) as we like so it will match as good as we can, or should we take *) as we meet it in the text? #include<stdio.h> char ch; int sem = 0; char str[16] = "=+-*/0123456789"; int search(char c) { int i; for(i = 0; i < 15; i++) if(c == str[i]) return 0; return 1; } void getChar() { scanf("%c", &ch); } void comment() { while(1) { getChar(); while(ch == '*') { getChar(); if(ch == ')') return; } if(feof(stdin)) { sem = 1; return; } } } void expr() { while(ch != ')') { if(search(ch)) { if(ch == ')') return; else if(ch == '(') { getChar(); if(ch == '*') comment(); else expr(); } else sem = 1; } getChar(); if(feof(stdin)) { sem = 1; return; } } } int main() { do { getChar(); if(feof(stdin)) break; if(ch == '(') { getChar(); if(ch == '*') { comment(); } else expr(); } else if(ch == ')') { sem = 1; break; } } while(!feof(stdin)); if(sem) printf("NO\n"); else printf("YES\n"); return 0; } Edited by author 09.07.2004 18:43 Try test: (1+2+3 ) Your program will print NO, but true answer is YES. You must control '\n'... I had same problem... |
WA 2 with C++ | Fritee | 1027. D++ Again | 30 Jan 2015 01:17 | 1 |
[deleted] P.S. Don't EVER forget to initialize your variables. Edited by author 30.01.2015 01:18 Edited by author 30.01.2015 01:19 |
WA Test #24 | Fasterm | 1027. D++ Again | 30 Dec 2012 19:50 | 1 |
Can anybody tell what the problem ? Edited by author 30.12.2012 19:51 |
WA 17 | SKYDOS | 1027. D++ Again | 20 Dec 2012 20:54 | 4 |
WA 17 SKYDOS 1 Aug 2009 15:17 what's in this test что в этом тесте может быть такого? перепроверил все уже... все примеры с форума, свои придумал, но все-равно ВА17 кто знает тест? Edited by author 01.08.2009 17:05 решил. спасибо всем ) Edited by author 01.08.2009 17:20 May be somebody knows the answer? I need an advice... Yeah!!! I solved it! You only need to look through themes before Edited by author 07.08.2009 20:52 Do not forget that space character can not be inside arithmetic expression! That was the reason why I got WA17. Re: WA 17 Inspector [Barnaul] 20 Dec 2012 20:54 Thank you, a good man) It realy works! |
WA26 | liuzy | 1027. D++ Again | 27 Sep 2012 13:54 | 1 |
WA26 liuzy 27 Sep 2012 13:54 I think my program is correct. Who can tell me why I got wa? #include<cstdio> #include<cstdlib> #include<cstring> char a[100005],b[100000]; char cs[]="=+-*/0123456789)("; bool pd(char ch){ for(int i=0;i<17;i++) if(ch==cs[i]) return 1; return 0; } int main(){ while(gets(b)){ strcat(a,b); } int len=strlen(a); int ha=0,k=0; for(int i=0;i<len;i++){ if(ha){ if(a[i]=='*' && a[i+1]==')') ha=0; }else{ if(a[i]=='*' && a[i-1]=='(') ha=1; else{ if(k>0 && (!pd(a[i]))){ printf("NO"); return 0; } if(a[i]=='(') k++; if(a[i]==')') k--; if(k<0) { printf("NO"); return 0;} } } } if(ha || k!=0) { printf("NO"); return 0; } else printf("YES"); system("pause"); return 0; } |
WA1 HINT | MOPDOBOPOT (USU) | 1027. D++ Again | 1 Aug 2012 17:34 | 1 |
WA1 HINT MOPDOBOPOT (USU) 1 Aug 2012 17:34 If you have WA1 just skip all #10 and #13 symbols from input data! |
WA2 solution | casey | 1027. D++ Again | 13 Jul 2012 12:00 | 1 |
You may not still be in a comment when you finish reading all input. |
Help with Test data #8 | __Emiapwil__ | 1027. D++ Again | 7 Apr 2012 14:04 | 2 |
Hey, everybody! I'd like to ask for a test data of this problem similar to test #8. I've read through the discussions and passed all the test data given in earlier topics but still got stuck at #8. Any help will be appreciated!! Edited by author 07.04.2012 14:05 I've figured out the problem! It seems that I'm not familiar with the 'feof' function's action. In fact earlier discussions mentioned it but since the vim editor appends a newline in the end of my test input file I was unable to notice this. May this be of any help for those who meet the same problem. |
Reg test suite for problem 1027. D++ Again | hariprasad.puvvadi | 1027. D++ Again | 17 Jan 2012 16:39 | 1 |
Is there any link where I can access\download the input test vectors for problem "1027. D++ Again" ? -Hari |
hint | Anton | 1027. D++ Again | 18 Dec 2011 19:03 | 1 |
hint Anton 18 Dec 2011 19:03 use state machine with char-by-char reading. We know last char and last state, so we can find next state. Brackets should be counting during reading. If we have '(', so we plus 1, ')' - minus 1. If brackets < 0 and state is some of arifmetic state - it's error. |
For those, who got WA#1 | Leonid (SLenik) Andrievskiy | 1027. D++ Again | 29 Nov 2011 19:21 | 2 |
I suppose test #1 is like this: ... (*my commentary*)(* my commentary with end of line*) (*(*my comment with two open brackets *) (12+13=45) (34+56 ) ... I think the first test is checking how can you work with EndOfLine symbol. It is allowed to be in any commentary and in any arithmetic expression. But if you change EndOfLine with whitespace (' '), remember, that ' ' is not allowed in an arithmetic expression! P.S. I replaced EndOfLine with '$' symbol and got AC. Edited by author 15.07.2009 17:24 thx I didn't really think about that :) > replaced EndOfLine with '$' symbol why would you do that? that's a stupid patch - you've just got lucky with your AC; it wouldn't pass if one of the expressions contained the actual '$' :) i just processed 0x0d and 0x0a as usual expression symbols |
Problem 1027 "D++ Again" has been rejudged. (+) | Sandro (USU) | 1027. D++ Again | 7 Nov 2011 00:39 | 1 |
New tricky test was added, and all AC submissions were rejudged. 96 authors lost AC. |
Test number 7 | nightwalker | 1027. D++ Again | 4 Nov 2011 03:26 | 9 |
It is something wrong. Can somebody help me? I have completed this problem. Test #7 is single '('. Thank you VERYYYYYY MUUUCH! I solved this problem because of yoy =) :-) :=) thanks a lot. After this test I got accepted My program passed this test '('. And also my program passed all the testes I've found here... but result is still WA7. I don't know why. Can someone help me? I've got an AC! Probably, my mystake was in wrong work with carrage return symbols.. Thankkkkkkkkkkkkkkkkkk a llotttttttt Exactly! Thank you very much. For all other users experiencing test#7 WA: Test your program exactly with this data: (<EOF> Got AC now thanks for test :) |