Show all threads Hide all threads Show all messages Hide all messages |
Page 2 |
WA4 | Grandmaster | 1071. Nikifor 2 | 23 Jan 2017 00:19 | 1 |
WA4 Grandmaster 23 Jan 2017 00:19 |
#2 | Domacles | 1071. Nikifor 2 | 30 Jul 2013 10:43 | 1 |
#2 Domacles 30 Jul 2013 10:43 |
WA#2 Help | ACSpeed | 1071. Nikifor 2 | 2 Dec 2011 21:53 | 1 |
I basically used brute force, if ( x==y) cout<<2; if (x < y) cout<<"No solution"; then the rest brute force |
Why WA in test №7? What's wrong? Who can help me? | ПирожкомейкерЪ | 1071. Nikifor 2 | 26 Nov 2009 15:49 | 1 |
var x,y,x1,y1,f,l:longint;a,b,c:array[1..1000] of byte; i,k,s,r,w,z:word; begin read(x, y); l:=2;w:=0; While (f<>1)and(l<=10) do begin i:=1; x1:=x; s:=0; c:=a; b:=a; Repeat c[i]:=x1 mod l; x1:=x1 div l; inc(i); inc(s) until x1=0; y1:=y;k:=0; i:=1; Repeat b[i]:=y1 mod l; y1:=y1 div l; inc(i); inc(k) until y1=0; r:=b[k];z:=1;i:=s; Repeat If c[i]=r then begin r:=b[k-z];inc(z);end; dec(i); until (z=k+1)or(i=0); If z=k+1 then begin f:=1;w:=l;end; inc(l); end; If w=0 then writeln('No solution') else writeln(w) end. Help me please... |
Faster Ideas | georgi_georgiev | 1071. Nikifor 2 | 30 Dec 2016 00:39 | 4 |
I Solved this problem, by transforming x and y into every system and search for the longest common substring. But I am interested in another Ideas, better than mine, except brute force. it isn't necessary to search LCS (O(|x|*|y|)), you can check only what y is subsequence of x, so it will be O(|x|+|y|) Edited by author 30.08.2009 16:00 Verification of this fact is O(log(max(x,y))) base = 2..1000 bruteforce, base > 1000 think a little :)) |
BRUTEFORCE rulzzzzzzzzzzzzzz | Roast | 1071. Nikifor 2 | 3 Aug 2009 18:13 | 1 |
The best way to solve this problem is with bruteforce... My brute: 0.031 121KB :) |
who used dinamic programming, please tell where it use | Головченко Дмитрий | 1071. Nikifor 2 | 11 May 2009 19:58 | 1 |
|
CAN YOU EXPLAIN THE QUETION NIKIFIR 2 EMILBEK_4@NETMAIL.KG | Emilbek | 1071. Nikifor 2 | 27 May 2008 15:49 | 1 |
|
Problem 1071 "Nikifor 2" has been rejudged (+) | Vladimir Yakovlev (USU) | 1071. Nikifor 2 | 5 May 2008 21:31 | 1 |
New tests have been added. 15 authors have lost AC. |
WA 15 | Robert_Khasanov(MSTU STANKIN) | 1071. Nikifor 2 | 3 Apr 2011 13:25 | 3 |
WA 15 Robert_Khasanov(MSTU STANKIN) 23 Jan 2008 20:10 Please give me some tests. try this: 1000000 499999 Edited by author 28.05.2008 22:05 |
What is the trick in test 11? | AlMag | 1071. Nikifor 2 | 19 Jan 2007 17:29 | 1 |
I WAS one of the ACers in this problem. I thought my algo was correct until... Can U tell me some tests to find out my mistake(s)? |
Page 1 |
Problem 1071 "Nikifor 2" has been rejudged (+) | Sandro (USU) | 1071. Nikifor 2 | 15 Jan 2007 15:34 | 1 |
New tests were added. 169 authors lost AC. |
What's the output for... | Alexey | 1071. Nikifor 2 | 12 Jun 2006 20:45 | 1 |
200 3 100 100 100 Is it -1? Edited by author 13.06.2006 11:57 |
Bruteforce with 0.001s and 146KB?! | tretyakov[ssau_618] | 1071. Nikifor 2 | 2 Feb 2006 16:57 | 1 |
How is it possible? There are really power server! |
Wrong answer test(6) Why?Help me+++++ | Виктор Крупко | 1071. Nikifor 2 | 4 Apr 2005 02:44 | 6 |
program de; var a,n,i,r,x,y,step,j:longint; q:boolean; s1,s2,s:string; begin step:=1; q:=false; read(x); read(y); repeat s1:=''; s2:=''; n:=x; inc(step); repeat i:=n mod step; n:=n div step; str(i,s); s1:=s+s1; until n=0; r:=y; repeat i:=r mod step; r:=r div step; str(i,s); s2:=s+s2; until r=0; j:=1; for i:=1 to length(s1) do if (s1[i]=s2[j]) and (j<>length(s2)+1) then inc(j); if j=length(s2)+1 then q:=true; until (step=x+1) or q; if q then writeln(step) else writeln('No solution'); end. For test 11 10 Your program writes 11 My AC program writes 'No solution' My AC program uses bases from 2 to 100000 How???? Виктор Крупко 4 Apr 2005 02:12 How to organize translation in other system of calculation, it is more 9 Part of my AC program: leny = lenx = 0; while (x > 0) ax[lenx++] = x % base, x /= base; while (y > 0) ay[leny++] = y % base, y /= base; x, y - decimal numbers base - system of calculation ax[], ay[] - x and y in new system lenx, leny - its lengths |
Help me!!!!!!!! why 6 test wrong answer???????? | Виктор Крупко | 1071. Nikifor 2 | 31 Mar 2005 00:23 | 1 |
program de; var a,n,i,r,x,y,step,j:longint; q:boolean; s1,s2,s:string; begin step:=1; q:=false; read(x); read(y); repeat s1:=''; s2:=''; n:=x; inc(step); repeat i:=n mod step; n:=n div step; str(i,s); s1:=s+s1; until n=0; r:=y; repeat i:=r mod step; r:=r div step; str(i,s); s2:=s+s2; until r=0; j:=1; for i:=1 to length(s1) do if (s1[i]=s2[j]) and (j<>length(s2)+1) then inc(j); if j=length(s2)+1 then q:=true; until (step=x+1) or q; if q then writeln(step) else writeln('No solution'); end. |
can the radix be greater than 10? | thwomass | 1071. Nikifor 2 | 24 Sep 2004 13:24 | 3 |
if so, it is a big problem of course! But it isn't a very big "problem"... It is a "for" after all Boo Boo! you can take it as 1, 1, 1 or 11, 1 or 1, 11 |
Why I got Output Limit? What does it mean? | Tang RZ | 1071. Nikifor 2 | 6 Jul 2004 16:39 | 2 |
My program: var x,y,x1,y1,k:longint; a,b:array [1..10000] of integer; procedure init; begin read(x,y); x1:=x; y1:=y; end; procedure work; var flag,flag1:boolean; k1,k2,k3,i:longint; begin k:=1; repeat x1:=x; y1:=y; inc(k); if k>=x then writeln('No solution'); k1:=0; k2:=0; repeat inc(k1); a[k1]:=x1 mod k; x1:=x1 div k; until x1=0; repeat inc(k2); b[k2]:=y1 mod k; y1:=y1 div k; until y1=0; k3:=1; for i:=1 to k2 do repeat flag1:=false; if b[i]=a[k3] then begin flag1:=true; b[i]:=-1;end; inc(k3); until (flag1)or(k3>=k1); flag:=true; for i:=1 to k2 do if b[i]<>-1 then flag:=false; until flag; end; procedure print; begin writeln(k); end; begin init; work; print; end. Write if k>=x then begin writeln('No solution'); halt; end; instead if k>=x then writeln('No solution'); and you'll get WA5 instead OLE3. |
I use Dynamic Programing ,which find LCS to solve this problem.I got AC,but it is too slow!!! | Yu YuanMing | 1071. Nikifor 2 | 25 Mar 2007 20:02 | 5 |
Yes, first I ACed the bruteforce algorithm in 0.187 sec, but later I added to it some mathematical hint. Now it works 0.046 sec. 866224 Hard (DHSP) Pascal Accepted 0.14 121 KB you can have O(s(x)+s(y)) instead of LCS s(a) is length of a in one's radix. Brute Force with 0.046 sec and 960 Memory |
Please tell me what "number system" and "minimal radix" means? | Bonny | 1071. Nikifor 2 | 10 May 2004 16:10 | 1 |
|