Common Boardsubstring "t" encounters in the input string twice, as many as "tebidoh" encounters. Yes ! =) So you can calculate amount of every letter and then print answer o(string length) Edited by author 17.10.2009 19:30 I use java BigInteger and get WA#7 I use formula f(n,k)=f(n-1,k)+f(n-1,k-1)+...+f(n-1,k-9) if you see it is wrong,please help Edited by author 25.01.2009 13:43 I use the same formula as you. and I get WA#7 too. Do you realize that the number of such tickets can be of the order of 10^N, that is an N-digit number, where N~50 of decimal digits? Edited by author 18.01.2009 03:51 Edited by author 18.01.2009 03:53 The formula is correct,just made a stupid bug: I wrote a[j][i]=a[j][i].add(a[j][l]) instead of a[j][i]=a[j][i].add(a[j][i-l]) :) Edited by author 25.01.2009 13:42 Edited by author 25.01.2009 13:42 I guess that the test 7 contains 50 900. The test 8 contains 50 450. Как их считать? пробую for i:=1 to n do begin for i:=1 to о do read(a[i,j]); readln; end; - зацикливается, пробую: for i:=1 to n do begin for i:=1 to о do read(a[i,j]); writeln; end; - не проходит 1 тест (из-за лишних переводов строки в исходных данных) =(( for i:=1 to n do for j:=1 to n do read(a[i,j]); двумерным массивом считываешь for i:=1 to n do begin for i:=1 to о do read(a[i,j]); writeln; 2 раза счётчик i используешь во вложенном цикле for i:=1 to n do begin for J:=1 to о do read(a[i,j]); writeln; Please ask anybody? why can be wrong answer on the first test? Почему не даются исходные данные данные хотя бы для 5 тестов??? Для самопроверки. a vse cifri daljni bit nepovtorimimi ili mojno povtarit??? The elements of the set must be different positive integers strictly less than 10^5.. a vse cifri daljni bit nepovtorimimi ili mojno povtarit??? But numbers can be repeated. Edited by author 17.10.2009 16:03#include <cstdlib> #include <iostream> using namespace std; struct xxx{ char x[30]; }A[100]; int main() {int n,i,j,k=0; cin>>n; fflush(stdin); for (i=0;i<n;i++) cin.getline(A[i].x,30); for(i=0;i<(n-1);i++) if (strcmp(A[i].x,"")){ for(j=i+1;j<n;j++) if (!strcmp(A[i].x,A[j].x)) {if(k==0){cout<<A[i].x;k++;} else cout<<endl<<A[i].x; for(j;j<n;j++) if(!strcmp(A[i].x,A[j].x)) strcpy(A[j].x,""); } } return 0;
} No. It means "more than or equal to 1" Edited by author 17.10.2009 13:50 I always think about this. It's like "tea moose" in one word :) When Timus was the big portal (nearby 2002-2003) and had an index, the origin of a word "Timus" has been described in section "About". There it has been written: "Timus" in interpretation from one of classic languages (I do not remember which) means spirit, courage, willpower, fortitude. Pronunciation (Greek): 'θʌɪməs Pronunciation same as at a "thymus" word (medicinal herb "thyme" (тимьян on the Russian language)). Edited by author 17.10.2009 00:31 My code: Program t1116; Const MaxN=15000; Type Kusok=record A,B,Y :integer end; Var F1,F2,F :array[1..MaxN]of Kusok; n1,n2,i,j,n :integer; j1,j2,i2 :integer; begin read(n1);for i:=1 to n1 do read(f1[i].a,f1[i].b,f1[i].y); read(n2);for i:=1 to n2 do read(f2[i].a,f2[i].b,f2[i].y); n:=0; j1:=1; j2:=1; for j1:=1 to n1 do begin for i2:=j2 to n2 do begin if f1[j1].b<f2[i2].a then break; if (f1[j1].a<f2[i2].a)and(f1[j1].b>f2[i2].b) then begin n:=n+1; f[n].a:=f1[j1].a; f[n].b:=f2[i2].a; f[n].y:=f1[j1].y; f1[j1].b:=f2[i2].b; end else if (f1[j1].a<f2[i2].a)and(f1[j1].b<f2[i2].b) then begin n:=n+1; f[n].a:=f1[j1].a; f[n].b:=f2[i2].a; f[n].y:=f1[j1].y; f1[j1].a:=f1[j1].b; break; end else if (f1[j1].a>f2[i2].a)and(f1[j1].b<f2[i2].b) then begin f1[j1].a:=f1[j1].b; break; end else if (f1[j1].a>f2[i2].a)and(f1[j1].b>f2[i2].b) then begin f1[j1].a:=f2[i2].b; end; end; j2:=i2; if f1[j1].a<>f1[j1].b then begin n:=n+1; f[n]:=f1[j1]; end; end; write(n,' '); for i:=1 to n do write(f[i].a,' ',f[i].b,' ',f[i].y,' '); writeln; end. Try the following input: 1 1 5 2 1 1 5 3 Output should be 0. > Try the following input: > > 1 1 5 2 > 1 1 5 3 > > Output should be 0. I dont think my answer is wrong since i worked it out with chess board itself. Then why WA1??? Is is something to do with output format?? please help. 10 d3 8 a8 2 h8 2 b2 4 a6 4 g5 6 e6 8 a1 2 f1 4 c3 8 They added new tests and... [SPbSU ITMO] WiNGeR aced in Java... But I think it's unfair to be too strict with such a NPC problem Edited by author 16.10.2009 11:39 Macarie misc [13] 23 Sep 2009 19:34 up! Oleg Strekalovsky aka OSt [Vologda SPU] Re: misc [11] 30 Sep 2009 21:44 How tests will be added for other problems? excuse me? Do you have some tests and want me to add them? Edited by author 30.09.2009 22:00 Oleg Strekalovsky aka OSt [Vologda SPU] Re: misc [9] 30 Sep 2009 22:56 O_o This project is Open? Every can add tests? Well not quite, but if you have some official tests and want to share, I can upload them on the site. Thanks Oleg Strekalovsky aka OSt [Vologda SPU] Re: misc [7] 4 Oct 2009 01:03 Well not quite, but if you have some official tests and want to share, I can upload them on the site. Thanks Official tests????? Your have a contact with administration of Timus??? Edited by author 04.10.2009 01:03No, I found the tests on the contests sites, back ago. For example, the problems 1002 1003 and 1004 are from CEOI 1999. please. help sorry, I have only the tests from CEOI... among these tests there are many incorrect Yeah, 1187 tests have some mistakes Edited by author 16.10.2009 05:03 it's very important for understanding the condition! of course In fact it is not "of course" And actually the only thing that makes it not ambiguos is sample test. Many systems allow to have test numbers to be not consecutive. It makes possible to make funny tasks with the 1st test which is sample and 3112nd test, which is not, when person gets WA #3112 and thinks like "WHAT????!!!" And the fact that tests on the competition in this task are consecutive is not obvious. Edited by author 12.10.2009 23:31 And, by the way, it is assumed in this problem that every solution acts exactly the same being run on the same set of tests, which is clearly not always true in the real world. Edited by author 29.10.2008 10:05 You are mistaken removing your message. I think that the problem is difficult, many solvers used random searh and brute forse and with n->1000 number of have solved will -> 10-30 So talk about algo was helpfull. I don't think this task will be that difficult... I do it in o ( n ^ 2 ) and it's not that hard and i thing i can do it n logn with some optimizations... Edited by author 17.10.2009 01:44 Why do i get WA #13? Help me! Thanks! Edited by author 24.08.2007 18:48 I WA #13 too help.... me too.....anybody know why? Don't use negative rate values |
|