| Show all threads Hide all threads Show all messages Hide all messages |
| 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 |
| n = 0 ? | Dima | 1047. Simple Calculations | 7 Jan 2015 12:53 | 5 |
n = 0 ? Может такое быть ? deleted [] Edited by author 07.01.2015 12:54 |
| What is test case #3? | Suchith J N | 1450. Russian Pipelines | 7 Jan 2015 08:54 | 1 |
I'm repeatedly getting WA in Test#3. I converted all weights to negative and used Bellman-Ford. I also checked if the destination is reachable from the source. Nevertheless, I'm getting WA in the same test case. Could someone give me test case #3? |
| What's wrong with my Topological Sorting? | Peter P | 1022. Genealogical Tree | 7 Jan 2015 04:09 | 2 |
I got WA#1 :( What's wrong bros? =============================================================== static int speakerCount = 0; static void solve() throws IOException { final int N = nextInt(); // graph[i][j] = true: i-th is parent of j-th final boolean[][] graph = new boolean[N + 1][N + 1]; for (int line = 1; line <= N; line++) { int parent = nextInt(); if (parent == 0) { continue; } int child = nextInt(); while (0 < child) { graph[parent][child] = true; child = nextInt(); } } StringBuilder speakerList = new StringBuilder(); final boolean[] visitedNodes = new boolean[N + 1]; while (speakerCount < N) { for (int node = 1; node <= N; node++) { if (!visitedNodes[node]) { visit(node, visitedNodes, speakerList, graph); break; } } } out.println(speakerList.toString().trim()); } private static void visit(int node, boolean[] visitedNodes, StringBuilder speakerList, boolean[][] graph) { // Stop if marked if (visitedNodes[node]) { return; } // Marked visitedNodes[node] = true; // Visit each child for (int child = 1; child < visitedNodes.length; child++) { if (graph[node][child]) { visit(child, visitedNodes, speakerList, graph); } } speakerList.insert(0, node + " "); speakerCount++; } Edited by author 23.05.2014 15:48 I think the problem is that a children could have more than 1 parent - and here you have to check if all of his parents have been printed. If you can't find the solution yourself - write and I will tell you a way. P.S. Other people say that "One of the lines in test 4 has trailing space. This old problem was designed for Pascal/C++, such inputs treated as a bad style nowadays." I don't know what this means, but first check if this is the problem! Edited by author 07.01.2015 04:12 |
| Test 4 | Fyodor Menshikov | 1258. Pool | 7 Jan 2015 04:05 | 2 |
Test 4 Fyodor Menshikov 5 Mar 2010 00:17 |
| WA at #14... | Mikhail Krivenko | 1588. Jamaica | 7 Jan 2015 03:48 | 2 |
can anyone help me with that? AC now Mikhail Krivenko 7 Jan 2015 03:48 |
| Why I get WA? Pelase, help me!!!!!!! | Revenger and NSC | 1136. Parliament | 7 Jan 2015 01:35 | 3 |
My code: [code deleted] Edited by moderator 20.06.2020 16:24 I solve it in absolutely the same way, I get WA too :( Set max id to 2 000 000 and max members to 65536 - it worked for me. |
| For those who had problems with test 11 and got AC | Ivanov Alexander | 1136. Parliament | 7 Jan 2015 01:27 | 2 |
What is the 11th test about? Two my solutions (on pascal and c++) got wa11 and I really don't know why. The limit is said to be MAX 3000 members and MAX id 65535, but with this limits I got Access Violation on 11. I set MAX members to 65536 and MAX id to 2 000 000 and it worked. |
| Clarity for Problem Statement | Jihan Yin | 1987. Nested Segments | 6 Jan 2015 22:49 | 2 |
My code got WA for #27. After checking forever for errors, I edited my comparison for my set so that if two distances are equal, the distance with the bigger key will come first as a last desperation. After submitting this, I got AC. I think this should be stated in the problem statement, because it affects the solutions. For those that don't understand what I'm talking about: Input: 2 1 1 1 1 1 1 (Before) WA 27 Output: 1 (After) AC Output: 2 Your sample is incorrect. Because in the statment: "The segments are ordered by non-decreasing ai, and when ai = aj they are ordered by decreasing length. All segments are distinct." |
| c# accepted | pav1uxa | 1493. One Step from Happiness | 6 Jan 2015 21:14 | 1 |
del Edited by author 06.01.2015 21:37 |
| AC with Visual C++ 2010, yet TLE 14 with G++ 4.9?! | Kirill Nikonov | 1176. Hyperchannels | 6 Jan 2015 19:03 | 1 |
Ridiculous! It's O(damn E)! AND I got rid of all the lists and used simple arrays instead. It just cannot get any faster than that... |
| try this test case: | Adhambek | 2040. Palindromes and Super Abilities 2 | 4 Jan 2015 22:13 | 1 |
aaabbbababbaaaa ans: 111111111111001 Edited by author 04.01.2015 22:13 Edited by author 04.01.2015 22:15 |
| Im getting CRASH on test2. plz help | Ibragim Atadjanov | 1125. Hopscotch | 4 Jan 2015 14:55 | 2 |
Edited by author 08.06.2009 19:23 me too UPD. Oh, I understood my problem. I misunderstood the statment. Actually, there are m rows and n colums. But i thought on the contrary. Edited by author 04.01.2015 15:04 |
| WA #10 | Spatarel Dan Constantin | 1623. Fractal Labyrinth | 4 Jan 2015 03:06 | 1 |
WA #10 Spatarel Dan Constantin 4 Jan 2015 03:06 Di and Do may _COINCIDE_. |
| Explain the statement, please | Burakov Vladislav | 2024. Adventure Time | 4 Jan 2015 02:35 | 2 |
Could someone please explain me what does phrase "Rocks of pairwise different colors" mean? I assume that in second example the only possible set of Rocks is "ababa", but I can see there 6 pairs of Rocks with different colors. The only possible match to the samples I can see is if you could pick a set of Rocks with at most k different colors, but I don't think it is the right meaning of the statement. Update: Yep, my last guess was correct after all. Edited by author 25.12.2014 00:30 Yep, I don't understand the phrase either. Please fix the problem statement. :) |
| test 4 | ilya trofimov | 2016. Magic and Science | 3 Jan 2015 23:32 | 2 |
test 4 ilya trofimov 17 Oct 2014 18:04 Precision????? or something special??? Same question here. Any hints? Edit: just a bug with initial speed vector. Edited by author 04.01.2015 06:34 |
| Not working and WA #1; what's wrong here? | Neeraj Kumar | 1585. Penguins | 3 Jan 2015 17:30 | 1 |
#include<stdio.h> #include <string.h> // n is not required at all, i am leaving it. int main(){ int n, ce, cm, cl, max = 0; char c; scanf ("%d", &n); while ((c = getchar())!= EOF){ if (c == 'E') ce++; else if (c == 'M') cm++; else if (c == 'L') cl++; } /* Emperor Penguin Macaroni Penguin Little Penguin */ max = (ce > cm) ? ((ce > cl) ? ce : cl) : ((cm > cl) ? cm : cl); if (max == ce) printf("Emperor Penguin"); else if (max == cm) printf ("Macaroni Penguin"); else printf ("Little Penguin"); return 0; } |
| test 1 | giorgi | 1263. Elections | 3 Jan 2015 15:47 | 5 |
test 1 giorgi 15 Dec 2011 01:53 #include <stdio.h> #include<string.h> int main() { int sel[10010],n,m,tmp,i; scanf("%d%d",&n,&m); memset(sel,0,10010*sizeof(int)); for(i=0; i<m; i++) { scanf("%d",&tmp); sel[tmp]++; } for(i=1; i<=n; i++) printf("%.2f%\n",((double)sel[i]*(double)100)/(double)m); return 0; } whats wrong? printf("%.2f%%\n", problem is here. it needs two % Re: test 1 Nodir NAZAROV Komiljonovich 9 Sep 2012 15:29 % should also be printed at the end, I just found this mistake :) I am also amazed by this. My code is working in ideone with single "%". http://ideone.com/cbm8uh Edited by author 03.01.2015 15:49 |
| If you have WA #12 . Try this test. | Adhambek C# | 1930. Ivan's Car | 3 Jan 2015 15:16 | 4 |
6 6 4 2 1 2 4 5 2 3 2 6 6 4 1 5 answer : 0 Edited by author 07.01.2014 01:25 ? 6 6 4 2 1 2 4 5 2 3 2 6 6 4 1 5 answer : 0 Edited by author 07.01.2014 01:25 are you sure? isn't the answer is 2 the optimal route is: 1 -> 2 -> 6 -> 4 -> 5 and requires no gear changes Of course . it is right answer |
| please help with WA10 | ZH | 2003. Simple Magic | 3 Jan 2015 14:34 | 3 |
Try Input 3 3999986 5999979 9999965 Output infinity Input 2 5999979 9999965 Output 2 Input 1 9999965 Output 1 Input 1 1 Output 0 Your tests are incorrect, cause 3 ≤ n ≤ 10 000 |