Common Board| Show all threads Hide all threads Show all messages Hide all messages | | Help needed | ile | 1008. Image Encoding | 17 Feb 2013 07:59 | 7 | Hey everyone, I'm very frustrated. I spent couple hours on this problem and couldn't get it in Java. it's always WA#2. Can anyone give me some test data? I know that input can be any of the two representations, and all test cases given in threads are passed. I have really no clue, what's going on. I also checked for line breaks in input and output files. nothing works Image in first format: 10 1 1 1 2 2 2 2 3 2 4 2 5 3 1 3 2 4 2 4 3 Image in second format: 1 1 T, R, RT, RB, T, T, , T, , . Sorry for late reply! Yes, that's exactly what I get. I don't think that the problem is within algo... I think there is some stupid mistake... something like extra line break or something else... =( The point is to read the statement thoroughly, more precise: Input One representation of the image will be given to your program in the input. Output Your program has to write other representation of the image to the output. I guess you can apply it yourself! I said that: "I know that input can be any of the two representations, and all test cases given in threads are passed." Read carefully before saying something... I'm really agree with you!!!And now I haven't fixed my WA2 yet!!!How can that be!!Could you give me some idea,ile?I have checked my code for a few days... | | Clarification of problem statement | ROHAN GULATI | 1106. Two Teams | 17 Feb 2013 01:46 | 2 | Does the problem statement meant that each member should have all his friends in the other team OR each member should have at least 1 friend in the other team ? If the first statement is correct the sample output does not hold. Please clarify. Thanks in advance Edited by author 17.02.2013 01:32 > If the first statement is correct the sample output does not hold. Then how do you think which statement is correct? :) | | whats wrong | zipopa | 1001. Reverse Root | 15 Feb 2013 22:25 | 1 | #include <iostream> #include <cmath> int i=0; using namespace std; void f(); int main() { cout.setf( ios::fixed ); cout.precision( 4 ); f(); return 0; } void f() { long int a; if (cin >> a) f(); if (i!=0) { cout << sqrt((double)a) << endl;} else i++; } | | was getting wrong ans then got accepted.. | shubham agrawal | 1014. Product of Digits | 15 Feb 2013 22:18 | 1 | use long long int instead of int , it may help.. | | Why WA on test#6???? | wangyin | 1406. Next Number | 15 Feb 2013 18:23 | 2 | Edited by author 20.08.2006 07:47 | | Hint for this problem | 198808xc | 1565. The Duel for Three | 15 Feb 2013 17:35 | 3 | This is a problem with possible loops in decision. That means your decision will be based on others' decision, which might again be based on yourself. I think the best way to solve this sort of problems is to use ITERATION. I believe that some people could solve this directly. If you are like this, please post your idea or formula, I want to know it very much. During iteration, we must pay attention to the initialization value. If you have a bad init-value, you will not be able to move even one step in this problem. In my opinion, the init-value could be set as: when someone is starting a duel, then he could win this duel with prob 1. By the way, iteration will stop very quickly, as the calculation is unusual: there is function "MAX". So do not worry about the complexity of the problem. At last, some test-data here: 1.0 0.8 0.5 0.30000000 0.17777778 0.52222222 1.0 0.5 0.0 0.75000000 0.25000000 0.00000000 1.0 1.0 0.0 0.50000000 0.50000000 0.00000000 1 0.9 0.8 0.11000000 0.08265306 0.80734694 1 0.99999 0.99998 0.00001000 0.00001000 0.99998000 (Suprising or not?) 1 0.0001 0.0002 0.99975002 0.00014998 0.00010000 So, Good luck. Thanks for your hint. I got WA12, then I increase iteration to 5000 times, it ac now. My AC solution doesn't use iterations. It is based on some formulas. Rules of the forum says that I mustn't post my solution. But I can send my solution to you if you want to. | | WA 21 | bayram | 1011. Conductors | 15 Feb 2013 16:27 | 1 | WA 21 bayram 15 Feb 2013 16:27 when you calculate q you must use (res-(1e-7))*q/100.0; | | about abababa | data lapiashvili | 1723. Sandro's Book | 15 Feb 2013 13:25 | 5 | is in your example abababa right answer aba or only a??? because a is 4 and aba is 3. test №1: "abababa" ; correct answer: "a" test №2: "abcde" ; correct answer: "abcde" For "abcde" correct: a, b, c, d, e, ab, bc, cd, de, abc, bcd, cde, abcd, bcde, abcde Edited by author 15.11.2010 10:11 why correct answer is "a" , in my opinion answer must be "ababa" cause prefix is like that 0 0 1 2 3 4 5 | | flaky problem statement | tyomitch | 1310. ACM Diagnostics | 15 Feb 2013 00:55 | 2 | "choosing" -> "chosen" "divided" -> "divisible" "satisfied" -> "satisfying the" "is really completely defines" -> "completely defines" These aren't just typos, they impede the understanding. | | Question! | uzairBaig | 1350. Canteen | 14 Feb 2013 16:54 | 3 | I cannot understand the problem. The question is phrased pOorly ! If there is anyone, who can tell me, the question clearly, I am ready to phrase it in a better way. Use this statements: 1) There are N different food stuffs in the menu but not all of them are at the distribution. 2) The food is cooked from M different food stuffs. 3) The first student eats and he is not poisoned. 4) The first block describes the food stuffs dangerous for the first student, 5) the next K blocks — for the rest ones. And try to think a little. It's not very hard. ;) Combination formula can help. | | Can anybody interpret the promblem for me? thx | ppchain | 1716. Alternative Solution | 13 Feb 2013 18:08 | 2 | The "YES" come from two ways:1) when there is not have answer.txt;2) when answer.txt contain it.but i can't figure out this related to pass test! pass test should be the output.txt's content is same to answer.txt. how to explain the hint's explanation? We answer "YES" if "YES" was right answer for previous test. | | I do not know how to solve it in C++. | Martin | 1716. Alternative Solution | 13 Feb 2013 18:06 | 3 | No matter when I used double or long double, my code still got TLE. Opt[Now][j][0] = Opt[Pre][j][0] + Opt[Pre][j][1] + Opt[Pre][j][3]; Opt[Now][j][1] = Opt[Pre][j - 1][0] + Opt[Pre][j - 1][2] + Opt[Pre][j - 1][1]; Opt[Now][j][2] = Opt[Pre][j][2] + Opt[Pre][j][3]; Opt[Now][j][3] = Opt[Pre][j - 1][2] + Opt[Pre][j - 1][3]; I had to write a Pascal code using extended and got AC. Could anyone tell me how to AC in C++? I know solution which can be written on all allowable languages. I suppose, this solution won't get TLE. Becouse it is O(1). I know solution which can be written on all allowable languages. I suppose, this solution won't get TLE. Becouse it is O(1). | | cub(N) Solution | aybek | 1297. Palindrome | 13 Feb 2013 14:42 | 1 | I don't know why this solution is correct, but it got accepted. I thought that this solution will get TL. Author of problem: easy tests? Who couldn't find solution try to understand this code: #include<map> #include<cmath> #include<ctime> #include<vector> #include<cstdio> #include<string> #include<cstring> #include<cstdlib> #include<iostream> #include<string.h> //#include<windows.h> #include<algorithm> #define y1 abcde #define sqr(x) ((x)*(x)) #define INF 20000000000000000 using namespace std; string s; int i,n,ans,j,l,r;
bool check(int l,int r) { for(int i = 0; i < (r - l + 1) / 2; i++) if (s[l+i] != s[r-i]) return false; return true; } int main() { //srand(GetTickCount()); #ifndef ONLINE_JUDGE freopen("a.in","r",stdin); freopen("a.out","w",stdout); #endif cin>>s; n = s.size(); i++; s = '#' + s; for(i = 1; i <= n; i++) for(j = i; j <= n; j++) { if (check(i,j)) if (j - i + 1 > ans) ans = j-i+1, l = i, r = j; } for(i = l; i <= r; i++) cout<<s[i]; return 0; } Edited by author 13.02.2013 14:44 Edited by author 13.02.2013 14:45 | | Test #2 | George | 1910. Titan Ruins: Hidden Entrance | 13 Feb 2013 00:29 | 1 | | | Algo. | IgorKoval(from Pskov) | 1647. Divide an Island! | 12 Feb 2013 23:33 | 5 | Algo. IgorKoval(from Pskov) 9 Apr 2012 02:25 What is algorithm? What formulas, theorems, equations and hints must I use? Re: Algo. IgorKoval(from Pskov) 15 May 2012 22:53 Suppose that answer is XY, where point X lies on CA and Y lies on CB. Then let CX = x, CY = y. Now you have two equations: x + y = P/2, x * y = CA * CB / 2 (P is perimeter). The rest of solution is straightforward. Re: Algo. IgorKoval(from Pskov) 16 May 2012 23:59 Thank you very much! Very good adia! P.S.: How get x * y = CA * CB / 2 ? Just simple: 2 * SQUARE_CXY == SQUARE_ABX 2 * 0.5 * x * y * sinXCY == 0.5 * CA * CB * sinXCY x * y == 0.5 * CA * CB x * y = CA * CB / 2 I think about it several minute. =) | | WHY "Runtime error" ????!!!!!! | Iuhenio{PSU} | 1821. Biathlon | 12 Feb 2013 23:06 | 1 | using System; class Program { static void Main() { int N = int.Parse(Console.ReadLine()); if (N > 0 && N <= 100) { string[,] IData = new string[N, 3]; string[] buf = new string[2]; for (int i = 0; i < N; i++) { buf = Console.ReadLine().Split(' '); IData[i, 0] = buf[0]; IData[i, 1] = buf[1]; IData[i, 2] = Convert.ToString(i + 1); } String[] Win = new string[N]; string[] Lider = new string[2]; Lider = IData[0, 1].Split(':'); int k = 0; for (int i = 1; i < N+1; i++) { buf = IData[i, 1].Split(':'); if (int.Parse(Lider[0]) > int.Parse(buf[0])) { if (i == 1 && (60 - double.Parse(buf[1].Replace(".", ",")) + double.Parse(Lider[1].Replace(".", ",")) < 30)) { Win[k] = IData[0,0]; k++; } Win[k] = IData[i, 0]; k++; Lider = IData[i, 1].Split(':'); } if (int.Parse(Lider[0]) == int.Parse(buf[0])) { if (double.Parse(Lider[1].Replace(".", ",")) > double.Parse(buf[1].Replace(".", ","))) { double tmp = double.Parse(Lider[1].Replace(".", ",")) - double.Parse(buf[1].Replace(".", ",")); if (i == 1 && tmp < 30) { Win[k] = IData[0, 0]; k++; } Win[k] = IData[i, 0]; k++; Lider = IData[i, 1].Split(':'); } } if (int.Parse(Lider[0]) < int.Parse(buf[0])) { Win[k] = IData[0, 0]; k++; } } Console.WriteLine(k); Array.Sort(Win); for (int i = 0; i < k; i++) { Console.WriteLine(Win[i]); } } } } Edited by author 12.02.2013 23:07 | | Идея | ibra (TNU) | 1414. Astronomical Database | 12 Feb 2013 21:25 | 2 | Идея ibra (TNU) 11 Jan 2012 15:04 Несмотря на то, что задача просто решеется с помощью std::set, я написал сжатый бор. Первый раз писать немного сложно, но весело. А теперь ещё и просто. а если в вершинах бора хранить не map<string, node*> а попроще map<pair<int, int>, node*>, то я думаю результат был бы более впечатлительным P.S. решайте сжатым бором Accepted 0.312 2 904 КБ Edited by author 11.01.2012 15:06 Re: Идея Andrew Sboev [USU] 12 Feb 2013 21:25 Pff, too easy with just map<string, bool>. 0,937s is enough. | | puzzle | lian lian | 1057. Amount of Degrees | 12 Feb 2013 20:54 | 5 | puzzle lian lian 3 Sep 2008 10:23 my program output result: 1 1000000000 3 13 -> 84 1 1 2 2 ---> 0 1 100 2 4 ->6 1 300 4 8 ->0 1 400 4 2 ->111 1 2147483647 13 3 --> 77520 1 2147483647 20 2 --> 84672315 1 3 1 2 --> 2 is right? if full right , but i alway wa #7, who can give much testdata to me ? Edited by author 03.09.2008 10:39 Edited by author 05.09.2008 02:08 all your answers are correct. tests you asked: 1 8 2 3 --> 1 1 900 2 10 --> 3 1 123456789 4 10 --> 126 1 999999999 8 10 --> 9 Thanks for your test,I'v got AC this problem! all your answers are correct. tests you asked: 1 8 2 3 --> 1 1 900 2 10 --> 3 1 123456789 4 10 --> 126 1 999999999 8 10 --> 9 Thanks from me too for the excellent testset! | | no impossible case???? | HM2P33 | 1106. Two Teams | 11 Feb 2013 21:51 | 2 | i've got AC but i omitted the case "impossible" (ie print "0"). it has always solution? >>Well, there is no solution, for example, if someone has no friends. UPD: Yes, I didn't read it correctly and I think there are really no impossible cases. Edited by author 11.02.2013 21:53 | | What is the answer for the such test case | Megakrit | 1837. Isenbaev's Number | 11 Feb 2013 21:46 | 2 | e.g. the input is (if I'm not wrong it's valid input): 3 Isenbaev A B A A A B B B What is the correct answer? My AC Solution's output: =============== A 1 B 1 Isenbaev 0 =============== |
|
|