Move 1988-2004 entries into subdirs
We we move 1988-2004 entries from all of a year's winning entries in a single directory to each winner being in their own sub-directory under the given year directory.
This commit is contained in:
1 parent
1e82e8aa3e
commit
d2a42f42e8
478 files changed
No files matched your search
@@ -0,0 +1,152 @@
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <setjmp.h>
|
||||
#include <ctype.h>
|
||||
#define new(PP) (PP *) malloc(sizeof(PP))
|
||||
typedef struct q {
|
||||
jmp_buf ppp;
|
||||
long qq;
|
||||
struct q *P;
|
||||
struct q *p;
|
||||
}
|
||||
PP;
|
||||
|
||||
PP *P;
|
||||
int aaaaaa=2;
|
||||
int aaaaaaa=1;
|
||||
|
||||
long qqq;
|
||||
|
||||
|
||||
aaAaaa(aa,aaa)
|
||||
char *aa;
|
||||
char *aaa;
|
||||
{
|
||||
char aaaa = 0;
|
||||
if ((((( aaa )))))
|
||||
{
|
||||
aaaa = *aa;
|
||||
*aa=0;
|
||||
aa+=strlen(aa+1);
|
||||
P =new(PP);
|
||||
P->P=P;
|
||||
P->p=P;
|
||||
}
|
||||
|
||||
if ((((( !setjmp(P->ppp) )))))
|
||||
{
|
||||
if ((((( !isdigit(*aa) )))))
|
||||
longjmp(P->ppp,aaaaaaa);
|
||||
else {
|
||||
P->p->P = new(PP);
|
||||
P->p->P->P = P;
|
||||
P->p->P->p = P->p;
|
||||
P->p = P->p->P;
|
||||
|
||||
P->qq = *aa--;
|
||||
P = P->p;
|
||||
aaAaaa(aa,0);
|
||||
}
|
||||
} else {
|
||||
if ( !aaaa&&!*aa )
|
||||
longjmp(P->p->ppp,aaaaaaa);
|
||||
|
||||
if ((((( (P->qq=aaaa)<10 &&!
|
||||
(isdigit(aaaa)) ||!
|
||||
(isdigit(*aa) ||!
|
||||
*aa ))))))
|
||||
{
|
||||
fprintf(stderr,"Usage %c%s <number>\n",
|
||||
(aaa[0]?7:aaaa),aaa+!aaa[0]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ppPppp(pp,ppp)
|
||||
PP **pp, *ppp;
|
||||
{
|
||||
int aa;
|
||||
if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa )))))
|
||||
{
|
||||
if ((((( *pp==ppp )))))
|
||||
{
|
||||
ppp = (*pp)->p;
|
||||
|
||||
if ( qqq<47 ) return;
|
||||
if ( ppp->qq!=48 ) return;
|
||||
|
||||
while ( ppp->qq==48 )
|
||||
{
|
||||
printf("%ld\n",qqq-45);
|
||||
*pp = ppp;
|
||||
ppp = ppp->p;
|
||||
}
|
||||
qqq -= 1;
|
||||
longjmp(ppp->ppp,aaaaaaa);
|
||||
} else {
|
||||
PP *p;
|
||||
|
||||
ppPppp(pp,ppp->p);
|
||||
for (p=ppp;p!=*pp;p=p->p)
|
||||
{
|
||||
int qq=4;
|
||||
if ((((( qqq<47 &&
|
||||
(qq=0,p->qq+=p->p->qq-96)>=48-qqq ||
|
||||
qqq>46 &&
|
||||
(p->qq-=p->p->qq)<0 )))))
|
||||
{
|
||||
p->qq += qqq+qq;
|
||||
if ( p->p==P && qqq<=46 )
|
||||
{
|
||||
P->p->P = new(PP);
|
||||
P->p->P->P = P;
|
||||
P->p->P->p = P->p;
|
||||
*pp = P = P->p = P->p->P;
|
||||
P->qq = 48;
|
||||
}
|
||||
|
||||
p->p->qq+=qq==0;
|
||||
p->p->qq-=qq!=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->qq += 48;
|
||||
}
|
||||
}
|
||||
if ( ppp->P==P ) longjmp(ppp->ppp,aaaaaaa);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qqq += 1;
|
||||
|
||||
while (48==P->qq )
|
||||
{
|
||||
P->P->p = P->p;
|
||||
P = P->p->P = P->P;
|
||||
|
||||
}
|
||||
|
||||
if ( ppp!=ppp->p->p || qqq<47 )
|
||||
longjmp(ppp->ppp,aaaaaa);
|
||||
else
|
||||
{
|
||||
printf("At most one remains\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
main(aaa,aaaa)
|
||||
int aaa;
|
||||
char **aaaa;
|
||||
{
|
||||
aaAaaa(aaa==aaaaaaa?aaaa[0]:aaaa[1],aaaa[0]);
|
||||
qqq = 39;
|
||||
ppPppp(&P,P->p);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#include <stdio.h>
|
||||
|
||||
main(argc,argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
long arg[100];
|
||||
int i,j;
|
||||
int base = 10;
|
||||
int start = 0;
|
||||
int end= strlen(argv[1]);
|
||||
|
||||
|
||||
for (i=0;i<end;i++)
|
||||
arg[i] = argv[1][i]-'0';
|
||||
|
||||
while ( end-start > 2 )
|
||||
{
|
||||
while ( arg[end-1] == 0 ) {
|
||||
printf("%d\n",base);
|
||||
end--;
|
||||
}
|
||||
while ( arg[start] == 0 ) start +=1;
|
||||
base += 1;
|
||||
|
||||
for (i=start+1;i<end;i++)
|
||||
for (j=i;j>start;j--)
|
||||
if ( (arg[j]-=arg[j-1])<0 )
|
||||
{
|
||||
arg[j]+=base;
|
||||
arg[j-1] -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
From: leo _at_ zycad -dot- com (Leo Broukhis)
|
||||
Date: Tue, 30 Jan 96 17:37:51 PST
|
||||
To: judges _at_ toad -dot- com
|
||||
Subject: IOCCC 1992 - a bug
|
||||
|
||||
Dear Judges,
|
||||
|
||||
albert.c (even in its fixed form) still has a bug. Although I don't
|
||||
remember the number that exposed the bug (afair, resulting in coredump)
|
||||
in albert.orig.c that has been fixed in albert.c,
|
||||
I've found a number exposing another bug: 10000000001 (that's 9 0's).
|
||||
Both albert and albert.orig loop without printing anything, although
|
||||
the first factor is 101 and is usually found in an instant.
|
||||
|
||||
Unfortunately, the e-mail address in albert.hint is no longer valid,
|
||||
and neither whois, nor replacing old domain name with a new one according
|
||||
to the MX records, nor Altavista Web search were successful.
|
||||
|
||||
...Fortunately, Albert van der Horst did send me an unobfuscated
|
||||
(but somewhat limited - it doesn't check the number for factors 2, 3, 5, 7)
|
||||
version of his program. I didn't have a chance to augment its functionality
|
||||
to the one of the contest entry.
|
||||
@@ -0,0 +1,85 @@
|
||||
Most Useful Program:
|
||||
|
||||
Albert van der Horst
|
||||
S P&A R&C
|
||||
Oranjestraat 8
|
||||
3511 RA UTRECHT
|
||||
The Netherlands
|
||||
|
||||
|
||||
Judges' comments:
|
||||
|
||||
For a canned example:
|
||||
make albert
|
||||
albert 1234567890123456789
|
||||
|
||||
We were impressed with the speed at which it was able to factor
|
||||
arbitrarily large numbers consisting of factors that fit into
|
||||
a long.
|
||||
|
||||
|
||||
Selected notes from the author:
|
||||
|
||||
The Obfuscated version of the Horst algorithm.
|
||||
|
||||
This program will factor unlimited length numbers and print the
|
||||
factors in ascending order. Numbers of one digit (e.g. 8)
|
||||
are rejected without notice.
|
||||
It quits as soon as there is at most one
|
||||
factor left, but that factor will not be shown.
|
||||
It accomplishes this efficiently, without resorting to division
|
||||
or multiplication, until the candidate factor no longer fits in
|
||||
a signed long.
|
||||
|
||||
The nicest way is to rename the program into e.g. 4294967297
|
||||
if you want to factor Fermat's 4th number. Then just run it.
|
||||
Or you may type "prog <some-number>"
|
||||
A nice one is also (30 ones)
|
||||
albert 111111111111111111111111111111
|
||||
|
||||
Apart from the foregoing there are no special execution instructions.
|
||||
|
||||
To customize the program into a factorizer of a fixed number, use
|
||||
cc albert.c -o 4294967297
|
||||
or some such.
|
||||
|
||||
There are no data files used, and it is not possible to feed input
|
||||
via stdin.
|
||||
|
||||
I think this program is a nice example of algorithmic obfuscation.
|
||||
Several times two similar algorithms are merged into one. Then you
|
||||
need quite some tricks to get it running, such as long jumps
|
||||
through recursive subroutines. I felt like a sword smith,
|
||||
welding the sword very long, folding it again to the proper
|
||||
length, keep on hammering till it is tight, then fold again.
|
||||
Always keeping it at the proper red hot temperature, but not too
|
||||
hot lest the hardness fades.
|
||||
The strict naming conventions for subroutines did not make things
|
||||
much clearer after all, but it was not supposed to.
|
||||
|
||||
I would like to draw attention to the robustness of the program
|
||||
with respect to error handling and the nice stopping criterion.
|
||||
The esthetic appeal of some lines is at the expense of clearness,
|
||||
I apologize.
|
||||
Running the program through the c-beautifier reveals nothing,
|
||||
it will only destroy some of the lay out.
|
||||
Running the program through lint shows the usual remarks for a
|
||||
K&R program. Defeating this through casts does not make a program
|
||||
cleaner in my opinion.
|
||||
|
||||
Here are some hints, but they may not be too helpful.
|
||||
1. The Horst algorithm is described in the Hobby Computer Club
|
||||
Newsletter, year 82, part 4, a real Dutch treat.
|
||||
Assembler, c and Forth version have been around for some years.
|
||||
2. Does fractal programming exist after all?
|
||||
3. You remember the ToomCook algorithm in Knuth?
|
||||
It uses iteration instead of recursion and is quite jumpy.
|
||||
This program shares these disadvantages in a modified form.
|
||||
4. The Conversion is to be found in Knuth, not so the Observation.
|
||||
The Observation: "if it ends in a zero, it is divisible by ten"
|
||||
|
||||
Copyright (c) 1992, Landon Curt Noll & Larry Bassel.
|
||||
All Rights Reserved. Permission for personal, educational or non-profit use is
|
||||
granted provided this this copyright and notice are included in its entirety
|
||||
and remains unaltered. All other uses must receive prior permission in writing
|
||||
from both Landon Curt Noll and Larry Bassel.
|
||||
@@ -0,0 +1,152 @@
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <setjmp.h>
|
||||
#include <ctype.h>
|
||||
#define new(PP) (PP *) malloc(sizeof(PP))
|
||||
typedef struct q {
|
||||
jmp_buf ppp;
|
||||
long qq;
|
||||
struct q *P;
|
||||
struct q *p;
|
||||
}
|
||||
PP;
|
||||
|
||||
PP *P;
|
||||
int aaaaaa=2;
|
||||
int aaaaaaa=1;
|
||||
|
||||
long qqq;
|
||||
|
||||
|
||||
aaAaaa(aa,aaa)
|
||||
char *aa;
|
||||
char *aaa;
|
||||
{
|
||||
char aaaa = 0;
|
||||
if ((((( aaa )))))
|
||||
{
|
||||
aaaa = *aa;
|
||||
*aa=0;
|
||||
aa+=strlen(aa+1);
|
||||
P =new(PP);
|
||||
P->P=P;
|
||||
P->p=P;
|
||||
}
|
||||
|
||||
if ((((( !setjmp(P->ppp) )))))
|
||||
{
|
||||
if ((((( !isdigit(*aa) )))))
|
||||
longjmp(P->ppp,aaaaaaa);
|
||||
else {
|
||||
P->p->P = new(PP);
|
||||
P->p->P->P = P;
|
||||
P->p->P->p = P->p;
|
||||
P->p = P->p->P;
|
||||
|
||||
P->qq = *aa--;
|
||||
P = P->p;
|
||||
aaAaaa(aa,0);
|
||||
}
|
||||
} else {
|
||||
if ( !aaaa&&!*aa )
|
||||
longjmp(P->p->ppp,aaaaaaa);
|
||||
|
||||
if ((((( (P->qq=aaaa)<10 &&!
|
||||
(isdigit(aaaa)) ||!
|
||||
(isdigit(*aa) ||!
|
||||
*aa ))))))
|
||||
{
|
||||
fprintf(stderr,"Usage %c%s <number>\n",
|
||||
(aaa[0]?7:aaaa),aaa+!aaa[0]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ppPppp(pp,ppp)
|
||||
PP **pp, *ppp;
|
||||
{
|
||||
int aa;
|
||||
if ((((( !(aa=setjmp(ppp->ppp))||aa==aaaaaa )))))
|
||||
{
|
||||
if ((((( *pp==ppp )))))
|
||||
{
|
||||
ppp = (*pp)->p;
|
||||
|
||||
if ( qqq<47 ) return;
|
||||
if ( ppp->qq!=48 ) return;
|
||||
|
||||
while ( ppp->qq==48 )
|
||||
{
|
||||
printf("%ld\n",qqq-45);
|
||||
*pp = ppp;
|
||||
ppp = ppp->p;
|
||||
}
|
||||
qqq -= 1;
|
||||
longjmp(ppp->ppp,aaaaaaa);
|
||||
} else {
|
||||
PP *p;
|
||||
|
||||
ppPppp(pp,ppp->p);
|
||||
for (p=ppp;p!=*pp;p=p->p)
|
||||
{
|
||||
int qq=4;
|
||||
if ((((( qqq<47 &&
|
||||
(qq=0,p->qq+=p->p->qq-96)>=48-qqq ||
|
||||
qqq>46 &&
|
||||
(p->qq-=p->p->qq)<0 )))))
|
||||
{
|
||||
p->qq += qqq+qq;
|
||||
if ( p->p==P && qqq<=46 )
|
||||
{
|
||||
P->p->P = new(PP);
|
||||
P->p->P->P = P;
|
||||
P->p->P->p = P->p;
|
||||
*pp = P = P->p = P->p->P;
|
||||
P->qq = 48;
|
||||
}
|
||||
|
||||
p->p->qq+=qq==0;
|
||||
p->p->qq-=qq!=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->qq += 48;
|
||||
}
|
||||
}
|
||||
if ( ppp->P==P ) longjmp(ppp->ppp,aaaaaaa);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qqq += 1;
|
||||
|
||||
while (48==P->qq )
|
||||
{
|
||||
P->P->p = P->p;
|
||||
P = P->p->P = P->P;
|
||||
|
||||
}
|
||||
|
||||
if (ppp!=ppp->p->p )
|
||||
longjmp(ppp->ppp,aaaaaa);
|
||||
else
|
||||
{
|
||||
printf("At most one remains\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
main(aaa,aaaa)
|
||||
int aaa;
|
||||
char **aaaa;
|
||||
{
|
||||
aaAaaa(aaa==aaaaaaa?aaaa[0]:aaaa[1],aaaa[0]);
|
||||
qqq = 39;
|
||||
ppPppp(&P,P->p);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user