Show all threads Hide all threads Show all messages Hide all messages |
If you have WA#1 | Vladimir Plyashkun [USU] | 1137. Bus Routes | 24 Jul 2024 22:36 | 3 |
be careful, you must output the number of stops in the new route k and NOT K+1 So, for example in C++ vector<int> res; ... cout << res.size() - 1 << " "; // check this. not cout << res.size() << " "; Edited by author 05.01.2014 23:39 or ... reverse(res.begin(),res.end()); |
Changes in problem 1137 "Bus Routes" | Sandro (USU) | 1137. Bus Routes | 8 Dec 2020 16:57 | 1 |
1. Limitations were changed. Now 2 ≤ m ≤ 200; 1 ≤ stop_ID ≤ 1000. In old version 1 ≤ m ≤ 1000; 1 ≤ stop_ID ≤ 10000, but there were no such tests. 2. Checker was updated. 3. Some new tests were added. 618 solutions lost AC verdict. Hint: if your solution got Runtime Error, check a stack size in your code. |
Input is incorrect!!! | Kirom `Ekexity [SESC17]💻 | 1137. Bus Routes | 7 Dec 2020 00:21 | 3 |
I have RE5, when I use var s = Console.Readline().Split() var sz = s[0]; var firstElement = s[1]; //!!!!!! There is RE! I have to impose conditions test5 and his input file have a line with only one ("1")!! Input doesn't break lines properly. Incorrect tests are fixed. |
Common sense? Oh, f@ck it. | Otisler | 1137. Bus Routes | 4 Dec 2019 10:39 | 1 |
Task: old bus routes can be equal to 1, and bus stops can also be equal to 1 .... Does it make any sense? Really? What did the authors think of when they put such conditions? |
WA#2 | So Sui Ming | 1137. Bus Routes | 8 May 2017 12:50 | 1 |
WA#2 So Sui Ming 8 May 2017 12:50 3 6 1 2 5 7 5 2 1 4 1 4 7 4 1 5 2 3 6 5 4 2 my solution: 15 2 5 7 5 2 1 2 3 6 5 4 7 4 1 4 2 2 4 1 2 3 4 1 4 1 2 3 4 1 my solution: 4 1 2 3 4 1 4 1 1 1 1 1 1 1 1 1 1 1 1 my solution: 1 1 1 Are there any test cases for debugging? |
why crash test 5??? | scythe | 1137. Bus Routes | 29 Sep 2015 06:14 | 6 |
Is something wrong with the input file format, is not as in the specification ( i lost 4 hours because of this ). To be sure read it with Scanner ( if you use java ). Edited by author 22.05.2012 02:47 Edited by author 22.05.2012 02:47 I have the same problem. In what direction i must dig? (C# is my language) OK, I did it. You need to read input until end (C++ style!). In C# you can use structure like that: while(Console.In.Peek() != -1) { //read input } Good luck :) I have the same problem, I am a python programer here is my code: import sys sys.setrecursionlimit(10**5) def find_tour(G): """ Where G is an undirected graph """ tour=[] visited_edges=set() def recurse(u): for v in G[u]: if (u,v) in visited_edges:continue visited_edges.add((u,v)) recurse(v) tour.append(u) recurse(G.keys()[0]) tour.reverse() return tour from collections import defaultdict def main(): G=defaultdict(list) n=input() for t in range(n): l=map(int,raw_input().strip().split()) for i in range(1,l[0]+1): G[l[i]].append(l[i+1]) r=find_tour(G) if len(r) and r[0]==r[-1]: s=" ".join(map(str,r)) s=str(len(r)-1)+" "+s print s else:print 0 main() The error is in the reading phase, but when I change the read part to: try: tokenizer=chain.from_iterable(line.strip().split() for line in stdinf) n=int(tokenizer.next()) for i in range(n): m=int(tokenizer.next()) u,v=-1,int(tokenizer.next()) for j in range(m): u=v v=int(tokenizer.next()) G[u].append(v) # print G except: pass I got an error in the 1st test case even when I dont have the same problem in my laptop. Thanks for any help that you can give me. OK, I did it. You need to read input until end (C++ style!). In C# you can use structure like that: while(Console.In.Peek() != -1) { //read input } Good luck :) Yes, got problem with test #5 input. Got AC after reading it the following way (python 2.7): all_input = iter(sys.stdin.read().strip().replace('\n', ' ').split(' ')) n = int(all_input.next()) for _ in xrange(n): m = int(all_input.next()) u = all_input.next() for i in xrange(m): v = all_input.next() ... u = v Edited by author 29.09.2015 06:14 Edited by author 29.09.2015 06:14 |
Wrong answer test #4 - Lỗi test case 4 | Administrator | 1137. Bus Routes | 19 May 2013 19:12 | 1 |
I have wrong answer test case 4? Can you give me exam! :( |
WA on test #1. Are tests correct? | cap_prot | 1137. Bus Routes | 5 Feb 2013 16:12 | 1 |
I have WA #1 Seems that test #1 is a test from statement. For this test my program outputs: 15 2 4 7 4 1 4 5 6 3 2 5 7 5 2 1 2\n And this is correct eulerian tour. And output in statement is different: 15 2 5 4 2 3 6 5 7 4 1 2 1 4 7 5 2\n May be the solution validator is wrong? Could somebody help, please. |
correct answer for this test? | Wojciech Wawrzyniak | 1137. Bus Routes | 24 Sep 2012 16:34 | 4 |
What answer should be for test 4 1 1 1 1 1 1 1 1 1 1 1 1 ? my is 1 1 1 .... but still get WA on WA3 or WA2 (depends on sth) 4 1 1 1 1 1 1 1 1 1 1 1 1 Test is incorrect "None of the routes shared the same section of road" I think this test is correct. There can be 4 different sections of road connecting station 1 with itself. |
Why wa on test 3??? | youth | 1137. Bus Routes | 22 Jun 2012 12:47 | 1 |
|
Look here!!! | Flyer | 1137. Bus Routes | 31 Jan 2012 23:01 | 3 |
I know, that it's impossible to solve this problem using 250KB memory. We need at least to read all data into memory. Tell me, am I right? Well, my program used 140 KB. Nothing very special :) |
Does this problem requires the route with minimum stops? | November Rain | 1137. Bus Routes | 19 Mar 2010 04:16 | 4 |
I think at one stop which is the start stop of another route,we can print that route start with the common stop.But this is not the solution with the minimum stops.I got wa on test 1.I'm confused.Can anybody help me? My code: [code cut out] Edited by moderator 09.08.2004 02:40 I have WA#1 too. But I think that my program must work correctly. I always output the route with a number of stops equal to the m_1+m_2+...+m_n (m_k is a number of stops in k_th route). So I have a question: for input 2 4 1 2 3 4 1 4 1 2 3 4 1 should I output 4 1 2 3 4 1 or the output 8 1 2 3 4 1 2 3 4 1 is also OK? I haven't looked November Rain's program yet, but I suspect he to have the same algorithm that I have. 2 4 1 2 3 4 1 4 1 2 3 4 1 Test is incorrect "None of the routes shared the same section of road" |
Is it possible to output 0? | Failed Peter | 1137. Bus Routes | 11 Jul 2009 20:24 | 6 |
It is possible to move from any stop to any other stop. On every step you can find number of stop, that is in our new rote now, and that in one of other rotes, and add this rote. May I mistaken? can the graph disconnect? No it is not. Or al leat my program never did and I got AC :))) Look at the statement. "..Fishburg old residents stated that it was possible to move from any stop to any other stop.." |
I found euler but always get WA#1 What? | Andrey Veselovskiy | 1137. Bus Routes | 11 Aug 2008 04:35 | 2 |
Sorry, i've just found my bug... I forgot to rotate me route Edited by author 14.03.2006 15:03 Oh, thank you very much! :) |
AC!Your task is to find the Euler Path.My algo is O(V+E).At first I am worried about the menory,but 430-300k AC. | Yu YuanMing | 1137. Bus Routes | 29 Jul 2008 15:31 | 5 |
Why did your program work so long? My algo was O(V+E) too. And I got AC with 0.001s I got ac in 0.015s,590k Just use eularian tour. I can be solved without Euler paths. Just DFS over bus routes, walking away for a side-cycle at each of its nodes if that side-route wasn't yet traversed. |
AC with 405KB, though...(+) | Maigo Akisame (maigoakisame@yahoo.com.cn) | 1137. Bus Routes | 14 Apr 2005 15:24 | 2 |
Below are the arrays I declared: const maxid=10000; maxedges=100000; var v1,v2:array[0..maxedges]of word; now:array[1..maxid]of longint; s:array[0..maxedges]of word; I supposed I should use 357+640=997KB, but the result was only 405KB...ft... maxid=1000........... I used Eular , I supposed I will use 800KB,but the result was only 80KB!!!!!faint!!! |
hehe | sup | 1137. Bus Routes | 1 Feb 2003 11:08 | 1 |
hehe sup 1 Feb 2003 11:08 |
Only "Begin End." can got Accepted !!!!!!!!!! ------Just Now, May be corrected later. | NOT To Try | 1137. Bus Routes | 1 Feb 2003 11:08 | 3 |
What is wrong with judge system?!!! I always get RF or CE.... :(((((( > What is wrong with judge system?!!! > I always get RF or CE.... :(((((( |
To admins!!!! Judge is wrong(+) | Nazarov Denis (nsc2001@rambler.ru) | 1137. Bus Routes | 24 Jan 2002 16:03 | 3 |
I get AC with this program: Program t1137; Var N :longint; begin assign(input,'1137.in');reset(input); Read(N); end. Also I get AC with another (rigth) program :=) In all program??? >>=[ + ] or only this... May be all my program is wrong, but got Accepted??? =) May be this?
> In all program??? >>=[ + ] or only this... > May be all my program is wrong, but got Accepted??? =) > May be this? > |