Skip to content

Instantly share code, notes, and snippets.

@wasabili
Created October 22, 2010 15:40
Show Gist options
  • Save wasabili/640784 to your computer and use it in GitHub Desktop.
Save wasabili/640784 to your computer and use it in GitHub Desktop.
Aznyan AA
int
stk
[ 2 << 14
]; int ps = 0; int kofi(){char
a [ 2 << 15 ]; int c[ 2<<
15 ];int n;
int s;char d[ 2<<
14 ];int p ; int
jm ; int i , j
,k ;char msg [ ]= {
0x2A, 0x2A , 0x57 , 0x65 ,
0x6c, 0x63 , 0x6f , 0x6d ,
0x65 ,32 , 116 , 111 ,
32 , 75 , 45 , 111 ,110 ,
32 , 70 , 120 , 1 *120 ,107 ,
0x21 , 1 +41 , 42 , 0 +10 } ; int
len = 1* 26 ; for (i = 0 ; i
< len ; i ++) putchar (
msg [ i + 0] ) ; while
(1 ) { ; char ppt [] = {
0x3e , 0x20 } ;for(i=0,j=k=0, k; i
<2 ; i ++ )putchar (ppt
[ i] );gets( a ) ;ps=s= p= jm = ( 0) ;
for ( n=0 ;a[n] != '\0' ; n++);n=n/12; for ( i= 0
;i < n; i += 1) { k=0 ;for(j=0;j<3; j++ ) {k*= 2
; if (1 -126-2 +1 == a[i*12+j*4] & a [ i *1* 12
+ j * 4+1]==-67 ) k=k+1;} c [ i ]= k; } for
(i =0 ; i<(2<<14); i++)d[i ] =0 ; for ( s=
0 ;s <n;s++) { k = c [ s ] ; if (jm) { if
(k == 6) jm ++ ; else if (
k == 7) jm -- ; } else
{if (k == 0)++p; else if ( k == 1
) { (--p ) ;} else if (k ==
2 ) { ++d [p];}else if (k == 3 ) { --
d [ p ]; } else if (k ==4) { putchar
( d[ p]); } else if (k == 5) {
d [ p] =getchar () ; } else if (
k == 6 ) { if (d [p ] ) stk [ps ++
] = s - 1;else jm = 1 ; } else {
if ( d [ p ] ) { s = stk [
-- ps ] ; }} } }puts ( "" )
; } } main ( int ac ,char * av [
] ) { ( ac > 1 && av [ 1 ]
[ 0 ] == 97) ? z ( ) : kofi (
) ; } int dp [ 1+1+1+ 1+ 1+ 1 +2995 ]
[ 2001 ] ; int z ( ) {int n, m, s,
i, j ,k,skp ; char a[ 2 << 8]; gets ( a ) ;
for (j=n=m = s =i =0 , skp =1 ; a [ i
]!= '\0'; i ++ ){ if (48 <=a [ i] & a
[i ]<=57) { skp =0; if( j== 0) n = n
* 10+a[i] - 48 ; else if ( j == 1
) m=m*10 +a [ i ] -48 ;else s= s
* 10+a[i] - 48 ; } else if(! skp ) ++
j ,skp=1; } for ( k = 1;k<= s;k ++ )
for (i=1 ;i <= m; i++ )dp[ k][ i ] =
( i>=k)?1: 0 ;for( i=1; i < n
* n;i++)for (k=s; k>=1 ; k --)
for (j=1;j<= m;j++)if(k >= j )
dp [k][j]=( dp[k-j][j- 1 ] +
dp [k][j-1]) % 100000 ; else
dp [k] [j] = dp[k][j-1 ] ; for
( j=dp[s][m ],i=1; j/ 10 > 0
; a[i-1]=j % 10+48,i++ , j =
j /10);a[i-1] =j%10+48; for ( j
= i-1;j>=0; j --)putchar ( a [
j ]);puts("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment