| Show all threads Hide all threads Show all messages Hide all messages |
| Sample output is nuts | DarkeN | 1121. Branches | 8 Apr 2009 15:53 | 1 |
I seriously think that sample output is screwed up. For example, the lowest line reads: -1 1 4 - 1 4 But taking into account the proximity of the branch with ID=4 (bin: 100) and the branch with ID=1 (bin: 001) shouldn't all non-negative numbers in line equal 5( bin: 101), like -1 5 5 -1 5 ? Could someone make it clear for me? I would be very grateful;-) |
| Compilation Error | Shelest Pavlo | 1521. War Games 2 | 8 Apr 2009 15:20 | 1 |
I receive compilation error but in Borland C++ all ok. What is problem? #include<iostream.h> #include<stdlib.h> #include<string.h> void main() { unsigned long N, K, i, position; char * mas[30000]; char * mas1[30000]; char * mas2[30000]; char * mas3[10000]; cin>>N; cin>>K; for( i = 1 ; i <= N; i++) { if(i < 30000) { ultoa(i, mas[i - 1], 10/* size(i)*/); } else if (i < 60000) { ultoa(i, mas1[i - 30001] , 10/* size(i)*/); } else if (i < 90000) { ultoa(i, mas2[i - 60001] , 10/*size(i)*/); } else if (i < 100000) { ultoa(i, mas3[i - 90001] , 10/*size(i)*/); } } i = 0; position = 0; int step = 0; while( i < N) { while(step < K) { if(position >= N) position = position - N; if(position < 30000) { if(strcmp(mas[position], "0") != 0) step ++; } else if(position < 60000) { if(strcmp(mas[position - 30000], "0") != 0) step ++; } else if(position < 90000) { if(strcmp(mas[position - 60000], "0") != 0) step ++; } else if(position < 100000) { if(strcmp(mas[position - 90000], "0") != 0) step ++; } position++; } step = 0; position --; if(position < 30000) { cout<<mas[position]; mas[position] = "0"; } else if(position < 60000) { cout<<mas1[position]; mas1[position] = "0"; } else if(position < 90000) { cout<<mas2[position]; mas2[position] = "0"; } else if(position < 100000) { cout<<mas3[position]; mas3[position] = "0"; } cout<<" "; i++; position ++; } } |
| Here my solution | yaho0o0 | 1457. Heating Main | 8 Apr 2009 12:57 | 3 |
#include <iostream> #include <stdio.h> using namespace std; int main() { int i,n,a; double o=0; cin>>n; for(i=1;i<=n;i++) { cin>>a; o+=a; } o/=n; fprintf(stdout,"%.6lf ",o); cout<<endl; return 0; } Edited by author 07.04.2009 21:17 Edited by author 08.04.2009 12:58 |
| English version bug in viewing source | I&K | | 8 Apr 2009 12:20 | 1 |
In English version of the site, the page offering to enter JUDGE_ID and password when viewing source has a button with Russian caption - "Продолжить" |
| Connecting carriages | Angelwarrior | 1276. Train | 7 Apr 2009 21:50 | 1 |
Simple questiong :D I just can't get it, how should we connect carriages? If we have "AA" "BA" "AB" what can we connect "AABA" or "AAAB"??? |
| here is my solution I've got AC 0,015 209kb | yaho0o0 | 1581. Teamwork | 7 Apr 2009 21:03 | 1 |
#include <iostream> using namespace std; int main() { int n,a[1024],br=1,i; cin>>n; cin>>a[1]; if(n==1) { cout<<"1 "<<a[1]; } for(i=2;i<=n;i++) { cin>>a[i]; if(a[i]==a[i-1]) { br++; } if(a[i]!=a[i-1]) { cout<<br<<" "<<a[i-1]<<" "; br=1; } if(i==n) { cout<<br<<" "<<a[i]; } } cout<<endl; return 0; } Edited by author 07.04.2009 21:12 |
| WA2 Help! | Rabidstorm | 1078. Segments | 7 Apr 2009 19:30 | 1 |
program Ural1078; var ok:array[1..500,1..500]of boolean; x,y,ans:array[1..500]of longint; a,b,n,max:longint; function dfs(o,l:longint):boolean; var i:longint; u:boolean; begin u:=false; for i:=1 to n do if ok[o,i] then u:=u or dfs(i,l+1); if max<l then begin max:=l; u:=true; end; if u then ans[l]:=o; exit(u); end; begin readln(n); fillchar(ok,sizeof(ok),false); for a:=1 to n do readln(x[a],y[a]); for a:=1 to n do for b:=1 to n do if (x[a]<=x[b])and(y[b]<y[a]) then ok[a,b]:=true; max:=0; for a:=1 to n do if dfs(a,1) then ans[1]:=a; writeln(max); for a:=max downto 1 do write(ans[a],' '); end. What is wrong??? |
| Am I wrong?Please give me some test. | yuyan | 1687. Numismatics for Fun | 7 Apr 2009 11:55 | 1 |
I use greedy to solve this problem. First,I scanned all the boxes.If it had N new different coins that Tom wanted.The purchase will added about N*100 Then,I think Tom would buy this box.And it costs him 100 yen. At last.If the purchase>0 ,then I would buy some boxes that Tom did not have been bought. I was WA on #1 Am I wrong? At last,I'm sorry for my poor English. Thanks a lot. |
| C# and stack overflow | diver_ru (Fishburg SAAT) | 1701. Ostap and Partners | 6 Apr 2009 18:57 | 1 |
I spent about 20 attempts on this problem (yea, it's funny). It's all because i got wa12 instead of crash 12 when my recursive dfs led to stack overflow. P.S. Test 12: n=50000,m=49999, and [probably] graph is line. Edited by author 06.04.2009 19:04 |
| About Stone pile(1005) | BakuBoy | 1005. Stone Pile | 6 Apr 2009 14:07 | 3 |
Who can explane me that question,thank you there're two piles where you must put stones with condition that differences in weight between piles should be the minimal. Edited by author 06.04.2009 14:10 |
| If you have WA on #16 | yuyan | 1689. Fisherman and Barbell | 6 Apr 2009 13:15 | 1 |
Please try this test.This test helps me a lot. 20 3 2 1 5 1 4 8 12 16 The answer is 0. |
| JUDGES! The 1st word: "farther" instead "father"! | BlackShark | 1053. Pinocchio | 6 Apr 2009 11:09 | 2 |
|
| WA on test 8... | Dexter | 1588. Jamaica | 6 Apr 2009 04:00 | 2 |
Help! I get Wrong Answer on test 8... If someone knows 8th test please post it...thanks I get wrong answer on test 8 too. |
| This is my code with !!!Crash!!! | Mihr Hovsep | 1446. Sorting Hat | 6 Apr 2009 02:56 | 2 |
# include <iostream.h> # include <string.h> int main () { char a[2002][202]; char b[10000][1000]; char c[10000][1000]; char d[10000][1000]; char e[10000][1000]; int n,i,j=0,k=0,m=0,h=0; cin>>n; for (i=0;i<2*n;i++) cin.getline (a[i],2002,'\n'); for (i=0;i<2*n;i=i+2) { if (a[i+1][0]-'0'=='S'-'0') { strcpy(b[j],a[i]); j++; } else if (a[i+1][0]-'0'=='H'-'0') { strcpy(c[k],a[i]); k++; } else if (a[i+1][0]-'0'=='G'-'0') { strcpy(d[m],a[i]); m++; } else if (a[i+1][0]-'0'=='R'-'0') { strcpy(e[h],a[i]); h++; } } cout<<"Slytherin:"<<endl;; for (i=1;i<=j;i++) cout<<b[i]<<endl; cout<<'\n'<<"Hufflepuff:"<<endl; for (i=1;i<=k;i++) cout<<c[i]<<endl; cout<<'\n'<<"Gryffindor:"<<endl; for (i=1;i<=m;i++) cout<<d[i]<<endl; cout<<'\n'<<"Ravenclaw:"<<endl; for (i=1;i<=h;i++) cout<<e[i]<<endl; return 0; } Tell mi what to do,please, and sorry for my English. your sorce is wronge it is crashing because of char a[2002][202]; char b[10000][1000]; char c[10000][1000]; char d[10000][1000]; char e[10000][1000]; you got to change to: char a[103][1002]; char b[102][1002]; char c[102][1002]; char d[102][1002]; char e[102][1002]; but on the first test the program output : Hufflepuff: Gryffindor: Ravenclaw: the wright answer is : Slytherin: Zlobeus Zlei Um Bridge Hufflepuff: Mac Go Nagolo Gryffindor: Ivan Ivanov Garry Potnyj Herr Mionag-Ranger Ravenclaw: Tatiana Henrihovna Grotter |
| Can someone help me with wa#7 | Igor Sarcevic | 1588. Jamaica | 5 Apr 2009 15:55 | 2 |
I spend 3 hours searching to find the bug, but i found nothing, pls help me solve it... i had the same problem, but after realising that i might have made a mistake somewhere, i tried test case someone else already posted: 5 0 0 0 2 1 1 2 0 2 2 so, when i "fixed" my program, now i have WA#4 instead of WA#7 :P |
| Admins, what are you doing? | Victor Barinov (TNU) | 1705. Gangster Hares | 5 Apr 2009 15:32 | 2 |
Rejudging of the contest after the contest is a VERY BAD THING! I am SURE that a lot of people who found solution for problem F can find error and write own sqrt function for int64. BUT if you have not tests that fails this on the contest you CAN NOT do rejudge after IT. YOU CAN CHANGE THE DESCRIPTION OF THE PROBLEM TO SATISFY THE DATA SET BUT YOU CAN NOT CHANGE DATA SET! In this case results of the contest is not objective at all. Edited by author 05.04.2009 01:58 We apologize to all participants of the online contest whose submit during the contest lost AC verdict. Adding new tests to the problems of Timus Online Judge is a usual rule of this site, but we agree that the rejudge of the contest is not fair thing. I'll try to explain why we he had to rejudge this problem. Because of technical error only 3 first tests from this problem's test set were installed to the Timus Online Judge. Unfortunately we have found this error only after the contest was finished. Now this problem has all tests that were prepared for the contest by its author. No new tests were added as a result of investigation of AC solutions of the contest. |
| Как сэкономить? | Ivanov Alexander | 1590. Bacon’s Cipher | 5 Apr 2009 15:24 | 5 |
Я построил дерево, программа работает правильно, но требует около 90МБ памяти. Как можно сократить количество используемой на дерево памяти? Попробуй взять другой алгоритм. Префиксные массивы проходят по времени. there exist simple O(N^2) DP (N^2 memory) but on the contest i have solve it in O(N^2) using hash (O(N) memory) How to DP in this problem? Что за дерево Вы строите? Я строил суффиксное дерево, представляя ребра как два целых числа - начало и длины. Всего я поставил ограничение на массив вершин, используемых деревом, 40000 вершин (что в память уложится по-любому - в вершине хранится начало текста, длина текста, и 26 указателей на потомков). Совет: дерево должно быть компактным, то есть не отводить по вершине на символ, а только на разветвления, в этом случае дерево требует O(m) вершин, где m - длина текста. Проходит наивный алгоритм построения за O(N^2). |
| what's output for N=8 , K=10 ??? | ss | 1009. K-based Numbers | 5 Apr 2009 13:51 | 7 |
> > I think it's 85096170 i've just got accpted thankz |
| TLE#47 | dimozzz | 1329. Galactic History | 5 Apr 2009 13:23 | 7 |
TLE#47 dimozzz 11 Mar 2007 15:14 I try to solve it for O(n * log(n) * log(n)). I don't understand why I can't passed it? Please help me. I can send my code. Edited by author 11.03.2007 15:15 Re: TLE#47 Giorgi Saghinadze (Tbilisi SU) 11 Mar 2007 16:10 you can solve this problem using one DFS. think about it Thank you very much. It's problem very easy... And I'm very stupid. Now I have AC. I've solved it with LCA Does more simple way exists? Re: TLE#47 Giorgi Saghinadze (Tbilisi SU) 11 Mar 2007 21:40 I've solved it with LCA Does more simple way exists? Yes of course. run DFS once and for each vertex remember when you came to this vertex and when you returned there. and then it's very easy to find answer:) Thank you for really good idea It's much more simple to implement then LCA:) |
| How to solve it? | birrd | 1705. Gangster Hares | 5 Apr 2009 08:38 | 2 |
|