| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Test 8 | Arsenal911 | 1014. Произведение цифр | 29 мар 2011 14:21 | 1 |
Test 8 Arsenal911 29 мар 2011 14:21 0 10 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 YES? |
| WA8 | vksv | 1130. Никифор на прогулке | 29 мар 2011 11:41 | 1 |
WA8 vksv 29 мар 2011 11:41 I am using recursion to solve the problem. But, I get WA8. I have debugged the code; but could not find any issues. What is the test case? Thanks, |
| WA#14 | dima11221122 | 1824. Ифрит-бомбардировки | 29 мар 2011 11:16 | 1 |
WA#14 dima11221122 29 мар 2011 11:16 |
| What is the test #4? | Newbies | 1826. Минное поле | 29 мар 2011 11:09 | 6 |
OK, what about: 6 1 20 30 30 2011 2011 ? My answer is 2134: 1+20 -> 1 -> 2010+2011 -> 20 -> 1+30 -> 1 -> 1+30 -> 1 -> 1+20 |
| help help | SCUQIFUGUANG | 1058. Шоколад | 29 мар 2011 10:37 | 1 |
Whether the barycenter of the polygon is must on the break-line ? thanks ~ |
| Either test is wrong or the picture! | Ahmed Ahmedov | 1319. Отель | 29 мар 2011 00:27 | 2 |
|
| WA#4.Where is my mistake? | plankton(Vologda ML) | 1048. Сверхдлинные суммы | 28 мар 2011 20:02 | 2 |
import java.io.*; class Assert { static void check(boolean e) { if (!e) { throw new Error(); } } } class Scanner { StreamTokenizer in; Scanner(InputStream is) { in = new StreamTokenizer(new BufferedReader(new InputStreamReader(is))); in.resetSyntax(); in.whitespaceChars(0, 32); in.wordChars(33, 255); } String next() { try { in.nextToken(); Assert.check(in.ttype == in.TT_WORD); return in.sval; } catch (IOException e) { throw new Error(e); } } int nextInt() { return Integer.parseInt(next()); } } public class Main { PrintWriter out; Scanner in; void solve() { int n = in.nextInt(); int a = in.nextInt() + in.nextInt(); int b; for (int i = 1; i < n; i++) { b = in.nextInt() + in.nextInt(); out.print(a + b / 10); a = b % 10; } out.print(a); } void run() { in = new Scanner(System.in); out = new PrintWriter(System.out); try { solve(); } finally { out.close(); } } public static void main(String[] args) { new Main().run(); } } I tried it without exceptions, and I got TLE. try this test : 3 1 0 8 1 9 1 Try using java.util.Scanner and remove the two first classes. Edited by author 28.03.2011 20:08 |
| test 12 - overview | Iskren Ivov Chernev | 1074. Очень короткая задача | 28 мар 2011 04:18 | 9 |
Hi everyone! I had WA#12 for quite a long time, even after I had tried all the tests listed here. I finally got AC after I checked the input for space characters (isspace). After that I hardcoded a check for ' ', '\n', '\r', '\t', '\v', '\f', '\a', '\b', (and removed the isspace) and it gave me WA. In the C standart isspace gives true only for space, newline (\n), carrige return (\r), horizontal tab (\t), vertical tab (\v), form feed (\f) AND others depending on the locale... I cannot understand what kind of symbols they have put in this test case because my program doesn't allow any whitespace at all (I handle each character one by one, and I look for perfect match for isdigit, '+', '-', '\0', 'e', 'E', so I just cant miss a space character) I suggest review of this test case and removing any fancy characters found in it. If someone wants to see my solution email me iskren [dot] chernev [at] gmail [dot] com You are right. It's a very strange test case. I couldn't pass without isspace(). There can not be any spaces or other stuff in the line? If there some simbol except { 0123456789+-.eE } I must print not floating point number. Am I right? Btw, I use gets() to read lines... Passed all test form the board however WA 12... I had the same problem. I start to think that std::string works not correct with such simbols. Thanks a lot. You are not right, guys. There is nothing special in 12 test as regards symbolic input. The trouble is in incorrect algorithm - only after I've found serious bug in my prog it easily got AC. really trouble in isdigit() if you add such code: for (int i = 0; i < 256; i++) { char c = i; //cout << i << endl; if (isdigit(c) && ((i > '9') || (i < '0'))) cout << i << endl; } you will get a WA1. it's trouble with intel c++ as aI understand. My first guess was wrong about srd::string Vedernikoff Sergey: I think you didn't use isdigit in your code. Edited by author 04.07.2008 19:45 Edited by author 04.07.2008 19:45 if you wrote your own isdigit can hehp you. for example such code: bool isdigit(char c) { return c >= '0' && c <= '9'; } > (i > '9') || (i < '0') you exclude nine and zero |
| не могу понять условие | pusho4eg | 1825. Ифрит-бомбардировки 2 | 28 мар 2011 00:39 | 2 |
Необходимо сложить площади двух колец и вычесть площадь их пересечения? |
| Test 1 | Giorgi Shavgulidze [Tbilisi SU] | 1159. Fence | 27 мар 2011 03:33 | 1 |
Test 1 Giorgi Shavgulidze [Tbilisi SU] 27 мар 2011 03:33 Isn't answer 40 on T1? trapeze with bases 10 and 4. Edited by author 27.03.2011 03:35 |
| It's impossible to view raiting (Best accepted submissions) | scorp | | 26 мар 2011 19:08 | 2 |
The problem is fixed. Thank you! |
| what is test 22? | tracyzhu | 1827. Войны туземцев | 26 мар 2011 13:06 | 7 |
Just some big test, probably without any 1's in the answer. To speed up your code, don't use stl structures - write your own hash. i have written my own hash to store m internal conflict and then check all n days.but also got tle. It is driving me mad! Do you have some better solutions? thx for help me. Edited by author 24.03.2011 16:11 Edited by author 24.03.2011 16:15 No, my solution is pretty straightforward - take every day and for all i from 1 to 50 check whether triple (a[n], a[i+n], i) occurs in the sequence that was read from the input. Overall complexity is O(50*n) assuming complexity of your hash is O(1) Edited by author 24.03.2011 16:22 I want know how to hash triple(ai,bi,di)..i use a list hash[len][ai] and scan it.I think it is the reason i got tle... AC with STL Hashing is somthing terrible. 1)form all possible segments ;2) sort it 3) find all belongings for each given conflict; 3) apply segment union - O(n) algo(very important! classical!) |
| 2 ADMINS: Weak tests | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1827. Войны туземцев | 25 мар 2011 18:52 | 2 |
Sent on timus_support a couple of good tests, which my program that works 0.25 sec on timus, passes in about 1 minute on my PC Your tests were added. Thank you. |
| What's the answer for these tests? | enoyps | 1827. Войны туземцев | 25 мар 2011 14:52 | 3 |
What's the answer for these tests? #1 8 4 3 2 1 4 3 2 1 2 1 2 2 3 4 2 #2 8 4 3 2 1 4 3 2 1 2 3 4 2 1 2 2 thanks. And you'd think that the admin is sitting all the time on the site and solving to test these examples? :) |
| An interesting solution | Slusarenko Alexey | 1269. Антимат | 24 мар 2011 15:34 | 3 |
Of cource this problem can be solved using Aho Corasick algorithm. But there is another much more simple, but not determenistic solution. A hash function can be used to compare substrings of the text and the words. First we should find the hash function for all the words. Then we should evaluate the hash function for each substring of the text that has the same length as some word. And finaly comparing this this values of hash functions gives us the answer. My implementation of this solution works even faster than implementation of Aho Corasick's algorithm. Using clever structures and technichs we can achieve complexity of O(L*sqrt(K)), where L is the length of the text and K is the total length of all words. O(L*sqrt(K)) ? L <= 900k, K<=100k This means L*sqrt(K) <= 285 mln - not really that fast.. Aho-Corasick is something like O(L + K*alpha) or O( (L+K)log(alpha) ), where alpha - alphabet size; clearly significantly better. Edited by author 24.03.2011 15:34 |
| Is d2 redundant? | Vitalii Arbuzov | 1759. Долгожители | 24 мар 2011 13:44 | 1 |
Can't understand why we need date starting from which person was the oldest. Also can't understand why this solution gets WA3. Can anyone help? import java.util.GregorianCalendar; import java.util.Scanner; public class P1759 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = Integer.valueOf(scanner.nextLine()); GregorianCalendar birth = (GregorianCalendar) GregorianCalendar.getInstance(); GregorianCalendar death = (GregorianCalendar) GregorianCalendar.getInstance(); long max = 0; int result = 0; long longestLiveDeath = 0; for (int i = 0; i < n; i++) { String[] dates = scanner.nextLine().split("\\s"); set(birth, dates[0]); set(death, dates[2]); long liveTime = death.getTimeInMillis() - birth.getTimeInMillis(); if (liveTime > max || (liveTime == max && death.getTimeInMillis() < longestLiveDeath)) { max = liveTime; longestLiveDeath = death.getTimeInMillis(); result = i; } } System.out.println(result + 1); } private static void set(GregorianCalendar date, String sDate) { String[] split = sDate.split("\\."); date.set(Integer.valueOf(split[2]), Integer.valueOf(split[1]), Integer.valueOf(split[0])); } } Edited by author 24.03.2011 13:45 |
| To admin | hich_am | 1404. Легко взломать! | 24 мар 2011 02:52 | 1 |
if the first caracter has a number less than 5 you should think on cyclic form. Exemple: the first carater given is d..the numro of 'd' is 3 and 3-5<0...so you have to add 26 and of course d comes y(because 3-5+26=24 and y has 24)... i whish i am clarified the point...good luck |
| Why crash??? | a.kim | 1021. Таинство суммы | 24 мар 2011 01:26 | 2 |
var a:array[1..1000]of integer; b:array[1..1000]of integer; n,m,i,j:integer; s:string; begin readln(n); for i:=1 to n do readln(a[i]); readln(m); for j:=1 to m do readln(b[j]); s:='NO'; for i:=1 to n do for j:=1 to m do if a[i]+b[j]=10000 then s:='YES'; writeln(s); end. Probably because the arrays should be 1..50000 istead of 1..1000 |
| What is the test#6??? | Programmer | 1122. Игра | 23 мар 2011 18:44 | 4 |
I don't need more. I found my BIG bug. what's your big bug?I also got WA6. you can choose every square as a center and not only top-left 4 as i misunderstood. Edited by author 23.03.2011 18:45 |
| it accepted! | Jumbo | 1800. Закон бутерброда | 23 мар 2011 16:01 | 2 |
var w,g,h,l,t:real; begin g:=981; read(l,h,w); if l/2>h then begin write('butter'); halt end; t:=sqrt(2*(h-l/2)/g); w:=frac(w*t/60); if ((w>=0) and (w<=1/4)) or ((w>=3/4) and (w<=1)) then write('butter') else write('bread'); end. var w,h,l:real; begin read(l,h,w); if l/2>h then begin write('butter'); halt end; if ((frac(w*sqrt(2*(h-l/2)/981)/60)>=0) and (frac(w*sqrt(2*(h-l/2)/981)/60)<=1/4)) or ((frac(w*sqrt(2*(h-l/2)/981)/60)>=3/4) and (frac(w*sqrt(2*(h-l/2)/981)/60)<=1)) then write('butter') else write('bread'); end. |