Common Board| Show all threads Hide all threads Show all messages Hide all messages | | 2 Admins: "IMHO: Rejudgement is needed." | Lomir | 1096. Get the Right Route Plate! | 26 Oct 2011 23:00 | 7 | My AC probram gets on samle test output 2 2 1 However this is an output of reversed sequence. It is even imposible to change 1/8 to 5/4. Good output: 2 1 2 What is more, in the problem statement is not written that any one shortest way of changing can be printed. Even for sampe test there are 2 way of solving it. Sorry for mine English. Thank you for help! Validator of this problem was fixed. Rejudge is finished. 56 AC verdicts turned to WA, but 12 WA got AC. IMO, tests are still incorrect. My program got TLE #10 after such debug submit: // some code here ... int m; void TLE(){ while(1); } int main(){ scanf("%d ",&m); if(m > 1000) TLE(); int u,v,x,a,b; REP(i,m){ scanf("%d %d ",&u,&v); if(u <1 || u > 2000) TLE(); // some code here } // some code here return 0; } Without assertions it got Crash #10... You are right! There was a route number 0 in several tests. Tests are fixed. The wrong verdicts will be rejudged. My AC solution give wrong (I think so) answer on this test: 4 6 8 5 4 7 4 1 5 6 1 8 Answer: 1 1 But we cannot do it. Solution means that we give our plate "1 8" to the driver of the 1st bus and he gives us plate "6 8". But his route is 6 and he gets "1 8". So his plate now doesn't correspond to its route. In statement is said "Any driver will agree to change his plate for another only if this plate has the number of his route". "1 8" doesn't have 6. Send me the code, please! goldenxbullet@gmail.com Thanks! | | WA1. What's wrong with the output? (Solved!) | Radiosterne | 1446. Sorting Hat | 26 Oct 2011 19:57 | 2 | The wrong line was: cout << endl << "Griffyndor:" << endl; Edited by author 26.10.2011 03:43 Edited by author 26.10.2011 19:58 Edited by author 26.10.2011 19:58 Solved! While solving this problem, pay attention to spelling of faculties ;-) | | test#26 | MoonRandom | 1027. D++ Again | 26 Oct 2011 15:40 | 1 | test#26 MoonRandom 26 Oct 2011 15:40 why test#26 ... what mean? | | what is it TEST3 | Daniel | 1877. Bicycle Codes | 26 Oct 2011 15:22 | 2 | i'm think test 3 incorrect. if use this method for read input data we got WA scanf("%s1 %s2",s1,s2); S1 = (s1[0]-'0')*1000 + (s1[1]-'0')*100 +(s1[2]-'0')*10 +(s1[3]-'0')*1; S2 = (s2[0]-'0')*1000 + (s2[1]-'0')*100 +(s2[2]-'0')*10 +(s2[3]-'0')*1; if use scanf("%d %d",&S1,&S2); we has CA | | Help, please! | Anuar | 1333. Genie Bomber 2 | 26 Oct 2011 15:15 | 1 | please, tell me how to solve this problem. I can't find right solution to this problem. | | This is problem 4103 / EPALIN on SPOJ | Nic Roets | 1354. Palindrome. Again Palindrome | 26 Oct 2011 05:58 | 2 | But the test data on SPOJ is wrong. Not really, you are allowed to add zero characters in spoj task, but here it's not allowed. | | >.< | Jordan Team | 1084. Goat in the Garden | 26 Oct 2011 02:01 | 1 | >.< Jordan Team 26 Oct 2011 02:01 please whate is the case # 4??????????? | | WA #2 ? | Uzbek boy | 1821. Biathlon | 26 Oct 2011 01:48 | 2 | WA #2 ? Uzbek boy 11 Oct 2011 03:25 please, give me any test for WA #2 WA#2 Siroj Matchanov [TUIT] 26 Oct 2011 01:48 I'm sick of it. Please explain it to me. I'm getting WA2. What am I doing wrong? This is my code: #include "stdio.h" #include "algorithm" #include "string.h" struct time { double s, os; //os - original time // s - finish time (+id*30) char name[21]; int I; time(const double S = 0, const int id = 0) :s(S), I(id) {} void inc(const int id) { os = s; s += 30*id; } }; int cmp(const void* a, const void* b) { return ( ((time*)a)->s > ((time*)b)->s ); } int cmp2(const void* a, const void* b) { return strcmp(((time*)a)->name, ((time*)b)->name); } int cmp3(const void* a, const void* b) { return ( ((time*)a)->os < ((time*)b)->os ); } int main() { int n; scanf("%d\n", &n); time* ts = new time[n+1]; time* ans = new time[n+1]; int m; float t; for(int i=0; i<n; i++) { scanf("%s %d:%f\n", ts[i].name, &m, &t ); ts[i].s = t + m * 60; ts[i].inc(i); } std::qsort(&ts[1], n-1, sizeof(time), cmp); int j=0; ans[j++] = ts[0]; for(int i=1; i<n; i++) { if( cmp3( &ts[i], &ans[j-1]) ) ans[j++] = ts[i]; } std::qsort(ans,j,sizeof(time),cmp2); printf("%d\n",j); for(int i=0;i<j;i++) printf("%s\n", ans[i].name); delete[] ans; delete[] ts; return 0; } Edited by author 26.10.2011 01:51 | | What`s wrong? | Lesnik_1 | 1068. Sum | 26 Oct 2011 01:34 | 1 | using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _1068 { class Program { static void Main(string[] args) { int number = int.Parse(Console.ReadLine()); int result = 0; if (number > 10000 || number < -10000) throw new Exception("BAD!!!"); if (number > 0) for (int i = 1; i <= number; i++) { result += i; } if (number < 0) for (int i = 1; i >= number; i--) { result += i; } Console.WriteLine(result); } } } | | 2 admins - 2 | DK [Samara SAU] | 1768. Circular Strings | 26 Oct 2011 00:34 | 11 | your 8h test is incorrect, the answer is ALWAYS NO if n != 4 if u contact me, I'll give you the prove Why do you think so? Do you mean there is no n-gons for n != 4 ? :) Regular n-gons with n != 4 can't have all vertixes with rational coordinates. But it's said in the statement that coordinates are given with some accuracy, so I think it's ok. Not, all is not OK cause to program with absolute precision will fail with WA. there are some problems like this: 4 0 0 0 1 1 1 1 0 //YES, obviously 4 0 0.000009 0 1 1 1 1 0 //YES or incorrect test due to 10^-5 restriction?! 4 0 0.00000000000000000000000000009 0 1 1 1 1 0 //YES or incorrect test due to 10^-5 restriction?! In the statement you may see two numbers: 10^{-5}, 10^{-10} So about your tests: The first, you are right, is YES, obviously. The second does not exist (By the statement, there are no such tests in testset!) The third is same to the first. why is 10^{-10} a minimal guarantees for 'YES' answer? this is just input precision. Edited by author 12.04.2010 03:49 I think that statement need an additional guarantee like "It is guaranteed that in the case of the positive answer the coordinates of the points can be changed by less than 10^(−10) [or another magic constant from jury solution] so that they become the coordinates of vertices of a regular n-gon written in the traversal order" For example, test: 5 1 0.5 0.654508, 0.975528 0.0954915, 0.793893 0.0954915, 0.206107 0.654508, 0.0244717 The answer is "YES" !!! Try this interesting test: 4 0 0.333333 0.5 0.666667 1 0.333333 0.5 0 The answer is NO. Edited by author 18.04.2010 11:57 I think, that answer on this test: 4 0.0000199999 0.0000100000 0.0000000001 0.9999900000 0.9999999999 0.9999900000 0.9999800001 0.0000100000 is YES for example, the resulting points are 0.00001 0.00001 0.00001 0.99999 0.99999 0.99999 0.99999 0.00001 but my AC program answers NO And I still think that this problem is much more hard, that author thinks, because of different precisions in the statement. | | Please help !! c++ | Daniel | 1001. Reverse Root | 25 Oct 2011 22:33 | 2 | #include <iostream> #include <cmath> #include <iomanip> #include <stdio.h> using namespace std; int main() { int i=0; float A[256*1024/2]; do { cin>>A[i];
if ( A[i]>=0 && A[i]<= pow(float(10),18) ) { std::cout.precision(4); std::cout<<fixed<<sqrt(A[i]); } else
i++; } while(i<(256*1024/2)); return 0; } Edited by author 25.10.2011 15:16 | | WA#11 | 3a[3.141592..]Jlu | 1530. Ones and Zeroes | 25 Oct 2011 22:26 | 2 | WA#11 3a[3.141592..]Jlu 18 Jun 2009 03:18 I've got wa#11. But all test in forum my prog give right answers. Please give me more testcase. try this: 8 01100110 01100110 01100110 10000000 | | Wrong answer(please help with input array) | Dmitriy | 1001. Reverse Root | 25 Oct 2011 22:19 | 5 | Code: C/C++ #include <iostream> #include <math.h> #include <stdio.h> int main() { const int N=10000; double a[N]; long count=0,i; while (std::cin>>a[i]) { std::cin>>a[i]; count++;} printf("\n"); for(i=count-1;i>=0;i--) printf("%25.4lf\n",sqrt(a[i])); return 0; } Question:How to insert an array to provide input before the end of the border Please help, I`am beginner=( Thanks. 1. N can be maximum 131072 so adjust N accordingly. 2. Move double A[N] outside the main function as it exceeds the stack memory. 3. Initialize i and increase it after reading a[i]. 4. You have two statements of cin >> a[i]. Delete the second one. 5. Eliminate %25.4 from the printing, leave just %.4 You'll get AC. Edited by author 08.09.2011 20:29 could you tell me , why 131072? The statement say that the input size does not exceed 256KB that means 262144 bytes. The "worst" input should be "d d d" etc (one digit number, one space) so there can be maximum of INPUT/2 numbers. 2 morbidel: thank you very much! | | please help me | NoN | 1012. K-based Numbers. Version 2 | 25 Oct 2011 20:08 | 1 | #WA 6 And give me some test,please )))))))) | | Is O(N^2) the fastest solution ? | N.M.Hieu ( DHSP ) | 1416. Confidential | 25 Oct 2011 16:23 | 6 | I think O(N^2) ( Prim + DFS )is the fastest way to solve this problem , is it right ? Tell me, Why Kruscal+DFS doesn't work? I have TLE#12. Should I write Prim? I think Kruskal + DFS is enough. Maybe you need to optimize your code. Nguyen Dinh Tu ( DHSP ), my fiend , has got AC with the complexity O(N^3)( 0.89s ) . He used Prim , too. OK, then tell me, please, how to find the second answer? I use DFS... May be I should delete the largest vertic and run Kruscal again? You may try adding each non-MST edge to the MST and delete the longest MST edge in the cycle. I don't know how, but my O(n^2) solution works 0.312 sec) | | What is the right answer on this test? | olpetOdessaONU [1 2/3] | 1728. Curse on Team.GOV | 25 Oct 2011 14:56 | 2 | 1 2 Kantorov Rubinchik 100 10 1 Rubinchik 20 I think it "Win Rubinchik" because team "Kantorov Efremov Rubinchik" is not played at all. | | how to take in account the time ? | svr | 1764. Transsib | 25 Oct 2011 12:58 | 2 | Is it standard maxflow problem? May be it is 4-types of products flow? AC without times using. LP problem for 4-component flow with help of simplex method(my smpmeth is above struct{__int64 intpart;__int64 num;__int64 denum;char sign;};) By the way, very good question: why maxflow algo doesn't work. Edited by author 24.10.2010 01:48 Edited by author 24.10.2010 01:49 Maxflow algo doesn't work because it uses ways like M-1-2-3-Y or M-4-5-6-Y, that are not available. | | Test #2 | Vitaliy Karelin | 1836. Babel Fish | 25 Oct 2011 10:45 | 11 | Test #2 Vitaliy Karelin 30 Apr 2011 15:52 What's wrong with this test? i have the same question. what's the catch? and what's with the "ambiguous" case? how can it be ambiguous? When tank angled too much, one or more of sensors will show 0. If 3 or 2 neighboring sensors shows 0, then you cant determine the angle, but at whole data is not erroneous, so you shall output "ambiguous" for exampe 10 0 1 1 0 - ambiguous 10 0 1 0 1 - error 10 0 0 0 0 - 0.0 10 0 1 3 1 - 104.166667 (not error!) 10 0 1 3 2 - 150.0 10 0 1 5 3 - 202.083333 10 0 1 3 5 - error Edited by author 01.05.2011 03:36 OMG, my program passed all these tests, but still WA#2. Do you have any other tricky tests? I don't know ;) naive o^2 * (h1 + h2 + h3 + h4) / 4 will pass test #2 (with checking erroneous data preliminarily of course) and will WA only at #3 try swap data, like this: 10 0 1 3 2 10 2 0 1 3 10 3 2 0 1 10 1 3 2 0 etc. Edited by author 01.05.2011 02:41 Of course, I considered this case. Now I have WA#4. This test helped me a little: 1000000 1000000 1000000 1000000 1000000 -> 1000000000000000000.000 I guess, there are exists such tests, where, while calculating the volume, the itermediate calculations exceed 2^64. The reason of WA seems to be this. P.S. Don't like Java :) bsu.mmf.team, did you find the mistake? What is it? Edited by author 05.05.2011 16:26 I've used extended (in Pascal) to perform all calculations. But I think precision of double also enough to perform it, because required "relative error of at most 10^6". I hope you're not using integers of any size to perform real-number calculations? ;) --- I've just sent my solution replacing extended to double - it still have AC. But when I replaced it again to single (Pascal) - I got WA #4. So, if you using float (in Java) you have to replace it with double Edited by author 05.05.2011 18:40 Yes, I found my mistake. I got AC after I changed my function, which checks if 4 points lie on the same plane. I rewrote it using only integer calculations. what the wrong with test case 2 ,passing all of the forum :(.help pls..!! Friend! Your swapping-advice very right but very very dangerous! My ideal AC program had 12 lost submissions due bad swapping. Example: 0 1 3 2 -> 3 1 0 2- good. 1 0 3 2 -> 1 3 0 2 - bad! But double swapping swap(y2,y3),swap(y1,y4) 1 0 3 2 ->2 3 0 1 - right again! P.S. Why 1 0 3 2 -> 1 3 0 2 - bad? In 1,0,3,2 we have ciclic 3>2>1>0 but in 1,3,0,2 this invariant killed ,nature of data changed. Edited by author 25.10.2011 11:07 | | Please help, what is test #5 | L.E.O. | 1871. Seismic Waves | 25 Oct 2011 09:37 | 6 | I using dfs, but always get WA5. Where was I mistake? Edited by author 18.10.2011 22:18 scanf("\n") ignore first ' ' symbols in next string. Edited by author 18.10.2011 19:43 Thank you, I got AC :) PS: fool mistake :( Tell this ""fool mistake"", please. I'm get WA5, because I'm wrong read data. Example: 2 A 1 B B 1 A message My init length message was 7, but actual init length was 9 (7 + 2 first space). "fool mistake": scanf("\n") - ignoring first '\n', '\t' and ' ', but to me need is ignoring first '\n'. | | Wa#7 | RAU66 | 1884. Way to the University | 25 Oct 2011 08:43 | 3 | Wa#7 RAU66 23 Oct 2011 22:16 I can't understand why wa7, can somebody give me test, please? Re: Wa#7 IgorKoval(from Pskov) 25 Oct 2011 03:27 Maybe precision or bad algo? =) I have solved this problem in fractional arithmetic. Edited by author 25.10.2011 03:28 Edited by author 25.10.2011 03:29 Would better to have all time intervals having int left and right points. For it we may use another length units shorter then 1m by 50 times. Edited by author 25.10.2011 08:44 |
|
|