| Show all threads Hide all threads Show all messages Hide all messages |
| Tests | Looksery ONU 1 2/3 | 1720. Summit Online Judge | 26 Nov 2009 03:20 | 2 |
Tests Looksery ONU 1 2/3 15 Oct 2009 01:32 Give pls some tests, for different errors Re: Tests Fly [Yaroslavl_SU] 26 Nov 2009 03:20 4 5 7 13 3 6 11 99 6 8 11 99 10 13 20 200 50 56 20 200 30 33 20 200 19 21 20 200 11 11 20 200 10 10 20 200 10 15 17 18 10 15 16 19 10 15 15 20 20 33 14 19 1 1 1 1 2222222222222221 2222222222222222 100000000000000000 200000000000000000 16 19 5 11 10 33 16 25 10 21 16 25 1 2 18 20 1 2 19 20 1 2 20 20 30 33 30 33 30 33 31 32 Answers: 5 89 87 178 40 69 109 17 19 0 0 2 0 1 3105 or so :) 0 10 10 3 2 1 4 2 |
| WHO ACCEPT? | aatrue | 1019. Line Painting | 25 Nov 2009 19:03 | 4 |
Who can give me a code,I want to learn how to slove this problem....My code always WA... Thanks! Edited by author 19.09.2008 09:44 I have accepted it. It's very easy problem :) Can you tell me an algorithm of this problem? at first n2, but my nlogn algo accepted just now. segment tree & binary search |
| WA5 | igorsky | 1650. Billionaires | 25 Nov 2009 17:49 | 2 |
WA5 igorsky 25 Nov 2009 17:26 I've got WA5. Could you please give some tests or hints? Thanks in advance. I've found the reason. Bug was related with case-insensetive sorting of output. |
| Hint | daftcoder [Yaroslavl SU] | 1729. Dead Man's Chest | 24 Nov 2009 01:51 | 2 |
Hint daftcoder [Yaroslavl SU] 14 Nov 2009 11:23 For accuracy of calculations use power-reduction formulas /* 2 * sin ^ 2 (a) = 1 - cos(2a) */ in the formula that calculates chords long. Re: Hint daftcoder [Yaroslavl SU] 24 Nov 2009 01:51 2 * R * sin( a / 2 ) = sqrt ( 2 R R 2 sin^2 ( a / 2 ) ) = sqrt ( 2 R R ( 1 - cos ( a ) ) = sqrt ( 2 R R - 2 R R cos ( a ) ) = sqrt ( R^2 + R^2 + 2 * R * R * cos ( a ) ) |
| Could anyone answer? | tashlion | | 24 Nov 2009 00:22 | 2 |
Could anyone advice me what books I should read and use for solving different problems Try "Introduction to Algorithms" by Cormen, Leiserson and Rivest :) |
| Weak tests | Oleg Strekalovsky [Retired] | 1741. Communication Fiend | 23 Nov 2009 01:43 | 21 |
Weak tests Oleg Strekalovsky [Retired] 3 Nov 2009 15:34 Мy very crazy program passed 19 Tests and get TLE 20. I may be wrong, but I think, that the first 19 tests are weak. My program can't passed so many tests with bug in algorithm. My be it is needed to check this tests and emulate EVERY possible and impossible situations. Your solution didn't pass so tests are OK. Tests are weak if your wrong solution passes all of them. I wrote bad solution and get AC at 19!!! tests. I use DP and DFS. It is very strange, that this bad solition passed so many tests... Maybe the first 19 tests are some small tests that some programs go wrong at it. 1741 is median of contest. Halph of problems are harder hailpf are simpler. I am myself made 1741 from 1 submission. But there is 1735:modelling optimal packing different subsets sum problem for which great Erdesh was able to give 500$ Finally AC by DP. I had a good sleep 8) Why do you think that 19 is "many"? Some problems on Timus Online Judge have more than 200 tests. :) Problem not in amount, but in qualitative. My wrong solution must not passed so many and get TLE, because it must get WA early :) That's all. Topic closed. You must get AC for this problem with the first attempt. It's very easy problem. =) You should not think about "weak" tests in this case) Fyodor Menshikov created test, where my AC program failure =) We always encourage you to send good tests to us :) Yep =) Some times I create "not bad" heuristic solution. I know, that it is not good, but some times only my coatch (not Timus) can create failure test after he sees the code :) Please said me I'm right? cracked on cracked, pirated licensed on licensed, cracked pirated on licensed, cracked, pirated thanks! Program can't be cracked. Update can be cracked. If update is Licensed or Cracked,then program became Licensed. If update is Cracked or Pirated,then program became Pirated. I correct my code, but I also got wa#8. What is wrong in my idea? 1) sort by xi; 2) linear algo to find D[n][pirated] and D[n][licensed] 3) when write(min(D[n][pirated], D[n][licensed])) or please give me some useful tests. thanks! Edited by author 17.11.2009 02:59 I correct my code, but I also got wa#8. What is wrong in my idea? 1) sort by xi; 2) linear algo to find D[n][pirated] and D[n][licensed] 3) when write(min(D[n][pirated], D[n][licensed])) or please give me some useful tests. thanks! Edited by author 17.11.2009 02:59 My solution use DFS. I try to get answer not for last program, but for first. We have one "start point" and many "end points". Use recursion to get min cost of updating to every version of program. Other only via email(only Russian) Edited by author 17.11.2009 15:28Oleg, use phrase "min cost" more carefully. =) Usually it means min cost max flow problem :)) Test by Fyodor Menshikov was added to the test set. Test by Fyodor Menshikov was added to the test set. Yep =) I'v got 2 WA, but last result is AC. I think, only I got WA. It's easy to break program, looking at it code =) Edited by author 23.11.2009 18:40 |
| WA on Test 4 | Armen Tsirunyan | 1360. Philosophical Dispute | 22 Nov 2009 21:41 | 3 |
Hi, everyone. I hate this problem, too, but there's a strange thing going on with test 4. My algorithm is very straightforward and it cannot possibly lead to a WA. It could be a TLE, I admit, but can anybody explain to me HOW is WA possible with this code? #include <iostream> #include <cmath> using namespace std; int main() { double t = 0; double eps; double x, y; cin>>x>>y>>eps;
eps*=eps; t = 0; while(true) { double c = cos(t) - y; double d = sin(pow(t,0.5)) - x ; if( c*c+d*d > eps/2) t+=0.007; else { break; } } cout<<t; return 0; } OK, I got AC. And I found my mistake. And inasmuch as I do hate this problem, and don't think this is a good problem, I want to tell everybody how to solve it. So, first of all, output the answer with precision 10^-5; Second of all, find the smallest positive t, such that cos(t) = y; Then while(sin(sqrt(t)) !~ x) t+=2pi. That's all. Good luck with this goddamn(this isn't a taboo word, is it?:)) problrm Thank you for your advice! Whith it I got AC without any WA!:) |
| WA 25 | sos1g3 [TSOGU] | 1238. Folding | 22 Nov 2009 11:35 | 1 |
WA 25 sos1g3 [TSOGU] 22 Nov 2009 11:35 My programm using dp... Why I have WA 25.Give any test,please. Sorry for bad English. |
| Sample test case | ftc | 1652. Banking Crisis | 22 Nov 2009 10:07 | 2 |
Could anybody explain, why Bank 3 could not buy debt of Bank 2 to Bank 1 and thus become responsible. As I think, it contradicts only common sense, but not the statement. But if we use common sense, should we disallow only such kind of loops (where A owes B and B owes A) or any loops (e.g. A owes B, B owes C, C owes A) ? |
| What is the test case 1? | Mohsen Biglari | 1007. Code Words | 21 Nov 2009 22:32 | 3 |
I got WA#1, now I ACed May be it'll help you: my mistake was that I replaced 0 by 1 |
| about using material | tashlion | 1083. Factorials!!! | 21 Nov 2009 17:04 | 1 |
Could any one advice me what books I should read and use for solving different problems |
| compilator | Ioffeg | | 21 Nov 2009 16:32 | 1 |
Please, add gnu c++ compilator. |
| AC at last!! :) | Denis Koshman | 1384. Goat in the Garden 4 | 21 Nov 2009 16:32 | 2 |
Precision of 1e-8 is ok to get AC (provided that you use only square roots, no trigonomety). I got AC using sin, cos broadly. |
| I don't know why mine got problem with the program C++ | CJH1996 | 1000. A+B Problem | 21 Nov 2009 15:00 | 5 |
#include<iostream> using namespace std; int main() { int a,b; cout<<"a" <<endl; cin>>a; cout<<"b" <<endl; cin>>b; cout<<a+b <<endl; system("pause"); } Can you tell me what's the prob????????? I don't understand what is the meaning of output and input even though i read the website you have told me. Can you briefly tell me about the meaning of output and input and the meaning of these two? I hope I can learn something from you. This problem haven't say print "a"and"b"letter before input.So I change your programme. #include<iostream> using namespace std; int main() { int a,b; cin>>a; cin>>b; cout<<a+b <<endl; system("pause");//return 0; } this can be better: #include<iostream> using namespace std; int main() { int a,b; while(cin>>a>>b) {cout<<a+b<<endl;} return 0; } Edited by author 21.11.2009 15:02 |
| What is wrong with my code ? | Sepehr Mousavi | 1636. Penalty Time | 20 Nov 2009 04:08 | 2 |
First, i sent my solution in Pascal and i got WA2 and then i wrote it in C++ and i got Accepted. I want to know my mistake in my Pascal solution. Here's my code in Pascal : [code deleted] Edited by moderator 17.11.2019 18:35 readln(n); You should read, not readln. |
| Strange constraint | Fedor Fominykh | 1564. Counting Ones | 20 Nov 2009 04:03 | 2 |
Obvious solution looks as: 1) Suggest f(n) = amount of ones in numbers from 1 to n 2) Make binary search for f(i) It is obvious right, but constraint for input number don't allow to fast writing this solution in cpp (because we need in BigInteger). So, in my opinion, constraint are bad. If we want to make hardships with standart types in cpp and pascal, should take 1 <= n <= 10^100. In other hand, if we don't want to make it, should take 1 <= n <= 10^15. Am I wrong? Oops! I was wrong. AC without BigInteger with using c++ now :-) |
| Why is my answer wrong?? | Rosandra | 1002. Phone Numbers | 19 Nov 2009 18:20 | 1 |
What is wrong with this code... it does exactly what the description says and I can't find my error. Could somebody take a look and help me a bit? using System; using System.Collections.Generic; using System.Text; namespace _1002.Phone_numbers { class Program { static void Main(string[] args) { List<char>[] dictionary = new List<char>[10]; (dictionary[0] = new List<char>()).AddRange(new char[] { 'o', 'q', 'z' }); (dictionary[1] = new List<char>()).AddRange(new char[] { 'i', 'j' }); (dictionary[2] = new List<char>()).AddRange(new char[] { 'a', 'b', 'c' }); (dictionary[3] = new List<char>()).AddRange(new char[] { 'd', 'e', 'f' }); (dictionary[4] = new List<char>()).AddRange(new char[] { 'g', 'h' }); (dictionary[5] = new List<char>()).AddRange(new char[] { 'k', 'l' }); (dictionary[6] = new List<char>()).AddRange(new char[] { 'm', 'n' }); (dictionary[7] = new List<char>()).AddRange(new char[] { 'p', 'r', 's' }); (dictionary[8] = new List<char>()).AddRange(new char[] { 't', 'u', 'v' }); (dictionary[9] = new List<char>()).AddRange(new char[] { 'w', 'x', 'y' }); List<String> inputs = new List<string>(); int c = -1; do { inputs.Add(Console.ReadLine()); c++; } while (inputs[c] != "-1"); bool procede = true; while (procede) { String number = inputs[0]; List<String> words = inputs.GetRange(2, Int32.Parse(inputs[1])); inputs.RemoveRange(0, Int32.Parse(inputs[1]) + 2); if (inputs[0] == "-1") procede = false; String output = String.Empty; while (words.Count > 0) { StringBuilder outputs = new StringBuilder(); for (int i = 0; i < number.Length; i++) { if (i == 1 && output == String.Empty) { words.Clear(); break; } foreach (String word in words) { bool check = false; if (dictionary[Int32.Parse(number[i].ToString())].Contains(word[0])) { for (int j = 1, k = i + 1; j < word.Length && k < number.Length; j++, k++) { if (dictionary[Int32.Parse(number[k].ToString())].Contains(word[j]) == false) { break; } else { check = true; } } if (check) { outputs.Append(word + " "); i += word.Length - 1; words.Remove(word); break; } } } } if (output == String.Empty) { output = outputs.ToString().TrimEnd(); } else { if (outputs.ToString().TrimEnd().Split(' ').Length < output.Split(' ').Length) { output = outputs.ToString().TrimEnd(); } } } if (output == String.Empty) { Console.WriteLine("No solution."); } else { Console.WriteLine(output); } } } } } |
| Mistake in statement | Scalar | 1592. Chinese Watches | 18 Nov 2009 17:15 | 3 |
In english language: "and the hour-hand rotates 60 times slower than the minute-hand." -> "and the hour-hand rotates 12 times slower than the minute-hand.", and similar mistake in russian. up Scalar 17 Nov 2009 00:43 Fixed Vladimir Yakovlev (USU) 18 Nov 2009 17:15 |
| Invalid links in 'New judgements' letter | Fyodor Menshikov | | 18 Nov 2009 16:57 | 2 |
Please, send a letter to support e-mail. |
| Idea | ilyamit | 1480. Coupons | 18 Nov 2009 16:02 | 6 |
Idea ilyamit 5 Nov 2007 15:38 What is idea for this priblem? I fill matrix for chess: n = 4 0101 1010 0101 1010 0 - smoll number 1 - big number Why my solve is wrong?((( I got WA4. Re: Idea Loky_Yuri [USTU Frogs] 6 Nov 2007 10:54 During the contest our team didn't solve this problem because of the same logic. Now I understand that the same idea but with putting the biggest number in the conner is so simple... Thanks! I got AC. Is true idea (for 4): 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 Edited by author 27.11.2007 15:37 Edited by author 27.11.2007 15:38 i am using BFS with queue |