| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Help with OLE #9. | Lebedev_Nicolay[Ivanovo SPU] | 1253. Некрологи | 6 июл 2009 18:45 | 1 |
I have OLE #9 many times. Can anybody check my code? |
| Plz, help me. WA3. | Programmer | 1030. Титаник | 6 июл 2009 16:14 | 3 |
The main idea is: w1,w2,l1,l2. r:=6875/2; dist:=r*arccos(sin(w1)*sin(w2)+cos(w1)*cos(w2)*cos(l2-l1)); I had a problem with parsing the input. It turns out that my logic is fine but got WA3 because it is the first test where the longtitude has 3 digits degrees value. I don`t remember Pascal. In C expression 6875/2 means 3437, not 3437.5 |
| My code in c++ works and I have AC, but I have WA2 with such code in Java . WHY | Mukhiddin | 1024. Перестановки | 6 июл 2009 15:43 | 2 |
this is my code in java: [code deleted] Edited by moderator 04.12.2019 20:55 I don't know java, but probably it would help you: i think answer in second test is 1 and test is smth like 3 1 2 3 my prog printed 0 in such a case, while right answer is 1, that's why i had wa... maybe there is same problem in your algo? |
| WA 29!!! | Lebedev_Nicolay[Ivanovo SPU] | 1463. Радость населению! | 6 июл 2009 00:14 | 5 |
WA 29!!! Lebedev_Nicolay[Ivanovo SPU] 29 апр 2009 22:36 Can anybody give me test for WA #29??? Will anybody answer my question??? Will anybody answer my question??? Maybe in year or two. Forum is not for instant answers. It is rather knowledge base. There is no answer to your question in the base yet. Maybe answer will appear but 99% that _you_ will first find the bug and post yourself test for the bug here than someone get wa29 and post test for it. At last, I've solved it)))) If you have WA29 try this test: 8 6 1 2 5 4 1 2 1 6 1 2 1 2 3 1 2 4 1 5 6 1 6 7 1 6 8 1 Answer is : 13 3 3 2 4 |
| Please Help!!! | Lebedev_Nicolay[Ivanovo SPU] | 1002. Телефонные номера | 5 июл 2009 19:41 | 2 |
How to solve this problem with building a graph??? I cannot understand. I understood solution of this problem, but now I have Crash access vialation at test #4. Why??? |
| Some info | OZone3 | 1396. Максимум. Версия 2 | 5 июл 2009 18:20 | 1 |
|
| I solved using DP, time=0.125, memory=4M | VasilySlesarev | 1152. Кривые зеркала | 5 июл 2009 17:48 | 2 |
How to solve it faster and use less memory? Edited by author 01.07.2009 17:14 I've solved this problem without DP. I used recursion. Time is 0.062, memory - 125 KB. |
| WA 9. Previous advice doesn't help | Nikita Artyushov (SPb SU, mat-meh) | 1190. Плитка шоколада | 5 июл 2009 03:31 | 1 |
|
| why sample input have 1 3 300,3 1 10 | Yoshinaz | 1004. Экскурсия | 4 июл 2009 15:48 | 2 |
it direct or undirect if undirect weight of edge (1,3) should be 300 or 10. there is more than one way between two spot |
| To admins: bug in checker | Alex Tolstov | 1075. Нитка в пространстве | 4 июл 2009 10:16 | 2 |
one of my Java solutions, prints "NaN" and gets AC. Edited by author 01.07.2009 19:53 Edited by author 01.07.2009 19:53 |
| How to solve it? Need DP? | panyong0202 | 1455. Свобода слова | 3 июл 2009 14:13 | 6 |
There many ways: 1) hash 2) suffix array 3) suffix tree 4) suffix automation 10000 suffices,graph of they. Suffix s1 connected with suffix s2 if exist word s, adjusting which to s1 we will have s2 as a rest. BFS in graph to find when rest will be equal empty:1) s=s1+s2; s=s3+s1+s4;s2=s1+s4. Ac at last with above approach. It imortant to right work with 20000. Edited by author 22.11.2008 14:52 Create characters tree for all words (allowing direct per-character steps at O(1) and enumeration of all children also at O(1)). DP over IxJ, I - word number, J - suffix length. Cover these suffixes with other words till length delta become zero. I used Dijkstra for that because length can change arbitrarily. Start in words which contain some other word as a prefix. Edited by author 20.08.2008 11:11 |
| WA #2 | Anton [SUrSU#6] | 1027. Снова D++ | 3 июл 2009 03:51 | 10 |
WA #2 Anton [SUrSU#6] 17 май 2006 15:47 Why a got WA on test 2? This is my code: #include <iostream> #include <algorithm> using namespace std; long hash[5001]; const char* expr = "=+-*/0123456789)("; void Print(const char* msg) { cout << msg; exit(0); } int main() { freopen("input.txt", "r", stdin); int ch, pr = ' ', pr2 = ' '; int state = 0, ostate, ps = 0, bal = 0; while ((ch = getchar()) != EOF) { if (state == 2 && strchr(expr, ch) == 0) Print("NO\n"); //else if (ch == '*' && pr == '(' && state != 1) { ostate = state; state = 1; } else if (ch == '(' && state != 1 && cin.peek() != '*') { ostate = state; state = 2; ++bal; } else if (ch == ')') { if (state == 2) { if (!bal) Print("NO\n"); else { --bal; if (!bal) state = 0; } } else if (!state) Print("NO\n"); else if (pr == '*' && pr2 != '('&& state == 1) state = ostate; } if (!(ch == '(' && cin.peek() == '*')) { pr2 = pr; pr = ch; } } if (!bal && state != 1) Print("YES\n"); else Print("NO\n"); return 0; } Explain please for program bugs For example, such test: (*) Right answer: NO Yes, my program solved this test! But... Test #2! Re: WA #2 VietDung_CNT46DH_VIMARU 18 май 2006 18:03 My solution solved all tests from forumboard, but i am always got WA on test 2. Please, help me!!! I've tested your program... Try such test: (**) Your program's output is NO. Oh, yes... I'm forgot to post new version of my program #include <iostream> using namespace std; const char* str = "=+-*/0123456789)("; void Print(const char* str) { cout << str; exit(0); } int main() { //freopen("input.txt", "r", stdin); int ch, bal = 0; int state = 0, ostate; while ((ch = getchar()) != EOF) { if (ch == '\n') continue; if (ch == '(') { if (cin.peek() == '*' && state != 1) { ostate = state; state = 1; getchar();
continue; } else if (cin.peek() != '*' && state != 1) { state = 2; ++bal; } //else //if (cin.peek() != '*' && state == 0) //Print("NO\n"); } else if (ch == ')') { if (state == 0) Print("NO\n"); else if (state == 2) { --bal; if (bal < 0) Print("NO\n"); else if (!bal) state = 0; } } else if (ch == '*') { if (cin.peek() == ')') { if (state == 1) { state = ostate; getchar(); } else if (state == 0) Print("NO\n"); } } else if (state == 2) { if (strchr(str, ch) == 0) Print("NO\n"); } } if (bal == 0 && state != 1) Print("YES\n"); else Print("NO\n"); return 0; } I have also WA2, but do not know why... Any new ideas aboubt damn test 2!? I am going crazy... #include <cmath> #include <cctype> #include <cstdio> #include <cstdlib> #include <iostream> #include <vector> #include <deque> #include <string> #include <set> #include <algorithm> #define FOR(i,to) for (int i = 0; i < int(to); ++i) #define SZ(a) a.size() using namespace std; string text; bool coment = false; bool formula = false; bool good = true; int open = 0; int main () { while (feof(stdin)) { char buf[10000]; gets(buf); text += string(buf); } FOR(i,SZ(text)) { if (coment) { if (text[i] == '*' && text[i+1] == ')') { i++; coment = false; } continue; } if (formula) { if (text[i] == '(' && text[i+1] == '*') { i++; coment = true; continue; } if (text[i] == '(') { open++; continue; } if (text[i] == ')') { open--; if (open==0) formula = false; continue; } if (strchr("=+-*/0123456789", text[i]) == NULL) { good = false; break; } continue; } if (text[i] == '(') { if (text[i+1] == '*') { i++; coment = true; continue; }else{ open++; formula = true; continue; } } if (text[i] == ')') { good = false; break; } } if (good && !coment && !formula) printf("YES\n"); else printf("NO\n"); return 0; } Edited by author 03.09.2007 13:10 if u have got a problem with test # 2 try this test '(*' correct answer is NO I think that this is not valid.. T.T Edited by author 03.07.2009 03:52 |
| Mistake in statement | OpenGL | 1343. 12 месяцев | 3 июл 2009 03:00 | 2 |
In russian wrong: "От ударов, щит разлетается на куски, ..." Right: "От ударов щит разлетается на куски, ..." |
| Lost accounts | OZone3 | | 3 июл 2009 01:53 | 1 |
Is it possible to retrieve lost accounts without using e-mail? There are two accounts. Passwords for both of them are lost. First account e-mail's domain become a second level regional domain, so there are no server any more running it. Second account's e-mail was binded to an ISP. Accounts are: OZone, OZone2. |
| How to avoid ML if use Aho-Karasik? | BAron | 1269. Антимат | 2 июл 2009 21:13 | 5 |
Key-Word-Tree have > 10000 tops(вершин). Every tops have children(all char(256))=> memory>256*10000 of int>8 mb! How???? Please help!!! P.S. Sorry for my bad english Edited by author 11.08.2007 14:13 >>юзай сжатый бор how 'sjatiy bor' can help? I got Ac without sjati bor Since you have only 10000 vertices, you can use short int for children links, and then you will fit into 8 Mb |
| Can anybody help me ? I don't understand, why I have WA#8. | Vladislav Ivanishin | 1096. Таблички с номерами маршрутов | 2 июл 2009 20:30 | 1 |
I use BFS. Main idea is rather simple. I have rewrited my program 2 times, but still WA#8 Edited by author 02.07.2009 20:30 |
| WA 9 | Nikita Artyushov (SPb SU, mat-meh) | 1119. Метро | 2 июл 2009 05:47 | 1 |
WA 9 Nikita Artyushov (SPb SU, mat-meh) 2 июл 2009 05:47 Could somebody help me, please? |
| No subject | Vladislav Ivanishin | 1354. Палиндром. Он же палиндром | 2 июл 2009 02:32 | 1 |
Edited by author 02.07.2009 21:24 |
| Weak tests | Alex Tolstov (Vologda STU) | 1198. Коррупция | 2 июл 2009 01:16 | 3 |
Weak tests Alex Tolstov (Vologda STU) 20 апр 2009 15:17 Hello! My AC solution can't pass this test: 8 2 3 0 1 3 0 1 2 4 0 5 6 0 4 6 0 1 4 5 0 5 0 3 0 Wrong Answer: 7 0 Correct Answer: 0 We added this test, but you are the only author who got WA on it. :) |
| why wa on test 30? | Cheryl | 1552. Brainfuck | 1 июл 2009 11:33 | 6 |
I know! Victor Barinov (TNU) 25 сен 2007 16:19 my WA on test 30 was because, I forgot: "If the pointer before increment points to the rightmost byte of the array, then after increment it points to the leftmost byte." and "If the pointer before decrement points to the leftmost byte of the array, then after increment it points to the rightmost byte." In the statement it is said, that you may assume to use at most 4 bytes, but it is not said WHICH four bytes.. In the case of test 30, the best four are the rightmost one and the three leftmost. However, now I'm stuck on 31... Yes!Thank.But I resolved this situation in array[4] but moving initial position in second cell. |