foo.cpp:1:1: error: 'include' does not name a type
include <cstdio>
^
foo.cpp:8:1: error: 'define' does not name a type
define REP( i , l , r ) for ( int i = l ; i <= r ; ++ i )
^
foo.cpp:8:43: error: 'i' does not name a type
define REP( i , l , r ) for ( int i = l ; i <= r ; ++ i )
^
foo.cpp:8:52: error: expected unqualified-id before '++' token
define REP( i , l , r ) for ( int i = l ; i <= r ; ++ i )
^
foo.cpp:10:39: error: 'i' does not name a type
define rep( i , x ) for ( int i = 0 ; i ++ < x ; )
^
foo.cpp:10:50: error: expected unqualified-id before ')' token
define rep( i , x ) for ( int i = 0 ; i ++ < x ; )
^
foo.cpp:12:44: error: 'i' does not name a type
define DOWN( i , r , l ) for ( int i = r ; i >= l ; -- i )
^
foo.cpp:12:53: error: expected unqualified-id before '--' token
define DOWN( i , r , l ) for ( int i = r ; i >= l ; -- i )
^
foo.cpp:22:7: error: 'll' does not name a type
const ll INF = ll( inf ) * ll( inf ) ;
^
foo.cpp:23:1: error: 'll' does not name a type
ll dp[ maxn ][ maxn ][ maxn ] , suff[ 2 ][ maxn ] ;
^
foo.cpp: In function 'void dfs(int, int)':
foo.cpp:26:76: error: 'i' was not declared in this scope
if ( used[ l ][ r ] ) return ; used[ l ][ r ] = true ; if ( l > r ) { REP( i , 0 , n ) dp[ l ][ r ][ i ] = 0 ; return ; } if ( l == r ) { REP( i , 0 , n ) dp[ l ][ r ][ i ] = t[ l ].u + ( i != w[ l ] ) * k ; return ; } REP( i , l , r ) dfs( l , i - 1 ) , dfs( i + 1 , r ) ; REP( i , 0 , n ) dp[ l ][ r ][ i ] = INF ; REP( i , l , r ) { suff[ 0 ][ n + 1 ] = suff[ 1 ][ n + 1 ] = INF ; DOWN( j , n , 0 ) { suff[ 0 ][ j ] = min( suff[ 0 ][ j + 1 ] , dp[ l ][ i - 1 ][ j ] ) ; suff[ 1 ][ j ] = min( suff[ 1 ][ j + 1 ] , dp[ i + 1 ][ r ][ j ] ) ; dp[ l ][ r ][ j ] = min( dp[ l ][ r ][ j ] , suff[ 0 ][ j ] + suff[ 1 ][ j ] + ll( k ) * ll( j != w[ i ] ) ) ; } } REP( i , 0 , n ) dp[ l ][ r ][ i ] += ll( sum[ r ] - sum[ l - 1 ] ) ; }
^
foo.cpp:26:86: error: 'REP' was not declared in this scope
if ( used[ l ][ r ] ) return ; used[ l ][ r ] = true ; if ( l > r ) { REP( i , 0 , n ) dp[ l ][ r ][ i ] = 0 ; return ; } if ( l == r ) { REP( i , 0 , n ) dp[ l ][ r ][ i ] = t[ l ].u + ( i != w[ l ] ) * k ; return ; } REP( i , l , r ) dfs( l , i - 1 ) , dfs( i + 1 , r ) ; REP( i , 0 , n ) dp[ l ][ r ][ i ] = INF ; REP( i , l , r ) { suff[ 0 ][ n + 1 ] = suff[ 1 ][ n + 1 ] = INF ; DOWN( j , n , 0 ) { suff[ 0 ][ j ] = min( suff[ 0 ][ j + 1 ] , dp[ l ][ i - 1 ][ j ] ) ; suff[ 1 ][ j ] = min( suff[ 1 ][ j + 1 ] , dp[ i + 1 ][ r ][ j ] ) ; dp[ l ][ r ][ j ] = min( dp[ l ][ r ][ j ] , suff[ 0 ][ j ] + suff[ 1 ][ j ] + ll( k ) * ll( j != w[ i ] ) ) ; } } REP( i , 0 , n ) dp[ l ][ r ][ i ] += ll( sum[ r ] - sum[ l - 1 ] ) ; }
^
foo.cpp:26:88: error: expected ';' before 'dp'
if ( used[ l ][ r ] ) return ; used[ l ][ r ] = true ; if ( l > r ) { REP( i , 0 , n ) dp[ l ][ r ][ i ] = 0 ; return ; } if ( l == r ) { REP( i , 0 , n ) dp[ l ][ r ][ i ] = t[ l ].u + ( i != w[ l ] ) * k ; return ; } REP( i , l , r ) dfs( l , i - 1 ) , dfs( i + 1 , r ) ; REP( i , 0 , n ) dp[ l ][ r ][ i ] = INF ; REP( i , l , r ) { suff[ 0 ][ n + 1 ] = suff[ 1 ][ n + 1 ] = INF ; DOWN( j , n , 0 ) { suff[ 0 ][ j ] = min( suff[ 0 ][ j + 1 ] , dp[ l ][ i - 1 ][ j ] ) ; suff[ 1 ][ j ] = min( suff[ 1 ][ j + 1 ] , dp[ i + 1 ][ r ][ j ] ) ; dp[ l ][ r ][ j ] = min( dp[ l ][ r ][ j ] , suff[ 0 ][ j ] + suff[ 1 ][ j ] + ll( k ) * ll( j != w[ i ] ) ) ; } } REP( i , 0 , n ) dp[ l ][ r ][ i ] += ll( sum[ r ] - sum[ l - 1 ] ) ; }
^
foo.cpp:26:144: error: 'i' was not declared in this scop