| Show all threads Hide all threads Show all messages Hide all messages |
| No subject | HCMUS - Team CHANT - The TESTER | 1355. Bald Spot Revisited | 16 Mar 2015 21:26 | 3 |
No subject HCMUS - Team CHANT - The TESTER 24 Jan 2009 11:50 Can Anyone give me some hints for test 3, I've been working on it for 3 days but still got test 3. I give the right answers for all the tests on forum Try this test 1 1 499 999 999 answer is 3. 499 999 999 = 691*723589 The spaces shouldn't be there in the last number by the way. |
| Runtime Error in Java | DanLong | 1000. A+B Problem | 16 Mar 2015 19:20 | 3 |
import java.io.BufferedReader; import java.io.InputStreamReader; public class AB { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(reader.readLine()); int b = Integer.parseInt(reader.readLine()); System.out.println(a+b); } } У меня такое же решение. Тоже не принимает... Numbers are located at the same line. So, first call of readLine() give you "a b", and second - null. |
| WA 8 | aslan7470 | 1081. Binary Lexicographic Sequence | 16 Mar 2015 15:21 | 1 |
WA 8 aslan7470 16 Mar 2015 15:21 |
| Why need long long type? | 666666 | 1822. Hugo II's War | 15 Mar 2015 21:45 | 1 |
I got WA at #4 by using int type but got AC by using long long I don't understand... I think the max of date is 1e6(maybe n=1e4 and every ti=100, in this way the sum time is 1e6 and it's max) Am I wrong? Who can tell me plz Edited by author 15.03.2015 21:47 |
| Другие языки программирования | Leo | | 15 Mar 2015 18:03 | 1 |
Здравствуйте, уважаемые администраторы! Я очень давно изучаю язык Action Script принадлежащий компании Adobe. У меня созрел такой вопрос: Вы добавите поддержку языков Action Script или отодвините всех программистов этой отрасли? |
| WA 2. Can someone tell me why. | Dev_Java | 1196. History Exam | 15 Mar 2015 15:57 | 1 |
Can someone tell me the test case 2 please. |
| 1017. Staircases HELP | Doro | | 14 Mar 2015 15:32 | 1 |
I am new in here and I need some help with 1017. Staircases. Edited by author 14.03.2015 15:34 Edited by author 14.03.2015 15:34 |
| WA #11 | wxy | 1601. AntiCAPS | 14 Mar 2015 14:23 | 2 |
What may it be? i've try any test i can think and any test in other discussins,but still WA #11. I tested : ------- WHAT ARE YOU DOING? - I AM EATING. - really? -Yes,(new line) REALLY! - ok, i KNOW. i TRUST YOU. ------- and my program output : ------- What are you doing? - I am eating. - Really? -Yes, really! - Ok, i know. I trust you. ------- I don't know what's wrong, help, please. It must be "i trust you." not "I trust you" |
| Ruby non, C++ oui | Donald Cameron | 1044. Lucky Tickets. Easy! | 14 Mar 2015 08:08 | 1 |
For my first try I wrote this: def sum_of_digits(n) sum = 0 while (n > 0) sum += n % 10 n /= 10 end sum end num_digits = gets.chomp.to_i exponent = num_digits/2 divisor = 10**exponent limit = (10**num_digits) - 1 total = 0 0.upto(limit) do |cur| upper = cur / divisor lower = cur % divisor total += 1 if sum_of_digits(upper) == sum_of_digits(lower) end puts total # eof For 2, 4 and 6 digits it got the requisite answers of 10, 670, and 55252. There was a bit of a pause while it crunched away at the 6-digit case, though. For 8 digits it … well, I let it run and went to do something else. Then I had the bright idea to time it (on mac OS X, using the time command): 4816030 real 1m42.596s user 1m34.222s sys 0m1.837s The right answer, but the last time I checked, one minute anything was greater than two seconds. What to do? It’s pretty clear that calling sum_of_digits a bunch more times than necessary is the biggest problem. For try #2, I precomputed the sums and stuffed them into an array, and indexed the array in place of calling sum_of_digits in the main loop. Here’s the result: time ruby lucky.rb < t8.txt 4816030 real 0m19.176s user 0m18.017s sys 0m0.313s A better than 80% speedup. Most times I would kill for that, but I still need to lose 95% of the remaining run time. How to do it? I checked … initializing the array of sums takes virtually no time, even if I write out the entire array contents to a file. So the main loop is killing me, and unfortunately I need a dramatic change of algorithm but I don’t see one. So … 1. Recode in C or C++ 2. Hell if I know Taking option 1, I got Accepted, with run times around 1.1 seconds or so for 8 digits. It's a straightforward translation to C++, very brute force. |
| If you keep getting WA#13 | PrankMaN | 1200. Horns and Hoofs | 13 Mar 2015 22:37 | 1 |
Try this test: -1 -1 1 Answer: 0.00 0 0 |
| Nice problem :) | Radoslav Dimitrov | 1067. Disk Tree | 11 Mar 2015 01:22 | 1 |
Solved it with time of 0.5 sec and using "Trie" where I keep the name of each directory as a node. |
| I get AC | novopashinwm | 2035. Another Dress Rehearsal | 10 Mar 2015 13:48 | 1 |
Write me novopashinwm@mail.ru |
| WA 5. Give me some tests, please | Eduard | 2032. Conspiracy Theory and Rebranding | 9 Mar 2015 21:24 | 1 |
Give me some input values with answers, please, so I could find out, what's wrong. |
| for wrong #4 | Bakhodir Boydedaev | 1573. Alchemy | 7 Mar 2015 22:44 | 1 |
if(s.equals("Blue")|| s.equals("blue")) if(s.equals("Red") || s.equals("red")) if(s.equals("Yellow") || s.equals("yellow")) |
| Combinatorial | _UnderScore | 1044. Lucky Tickets. Easy! | 7 Mar 2015 12:51 | 3 |
Can anybody explain the combinatorial approach of this problem ??? Greetings the solution is very simple, combinatory isn't needed ;) I think it is coz brute force would be a good pain in ass with n > 9. But if u find a general solution with combinatorics it would be very efficient. I could not find one, though. |
| Java. Wrong answer. Test 2. | Daniil | 1001. Reverse Root | 6 Mar 2015 20:40 | 2 |
import java.io.*; import java.lang.*; import java.util.*; public class MathSqrt { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); double[] array = new double[4];
for(int i = 0; i < array.length; i++) { array[i] = sc.nextDouble(); }
for(int i = array.length - 1; i >= 0 ; i--) { double b = Math.sqrt(array[i]); System.out.println(b); }
} } Edited by author 18.02.2015 17:39 Edited by author 18.02.2015 17:39 Why length of your array is 4? It's acceptable to the first test, but there is not a certain amount of numbers in the task. |
| TL help me | Nodirbek Islomov | 1989. Subpalindromes | 6 Mar 2015 14:25 | 2 |
Hint: A string is palindrome if (and only if) its "RIGHT to LEFT" hash and "LEFT to RIGHT" hash are the same. Also for "Change" queries you need to use some data structure, such as Fenwick Tree or Segment Tree. Edited by author 06.03.2015 14:26 Edited by author 06.03.2015 14:26 |
| What is test 1? | novopashinwm | 2035. Another Dress Rehearsal | 6 Mar 2015 12:48 | 1 |
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _2035 { class Program { static void Main(string[] args) { string[] arrS = Console.ReadLine().Split(' '); long a = long.Parse(arrS[0]); long b = long.Parse(arrS[1]); long c = long.Parse(arrS[2]); //10^9 =1 000 000 000 if (((c - b) > a && (c-b)>0)) Console.WriteLine("Impossible"); else if (((c - a) > b && (c-a)>0)) Console.WriteLine("Impossible"); else if ((c - b) > 0 ) Console.WriteLine("{0} {1}", (c - b), b); else Console.WriteLine("{0} {1}", (c - a), a);
} } } Edited by author 06.03.2015 12:54 |
| If you get WA3 | Tural Neymanov | 2024. Adventure Time | 4 Mar 2015 21:58 | 2 |
Notice that k maybe be bigger than n. |
| test #11 | Alexander Bondarenco | 2014. Zhenya moves from parents | 4 Mar 2015 21:47 | 1 |
test #11 Alexander Bondarenco 4 Mar 2015 21:47 Could anyone provide any information about the 11-th test? |