0w1

Entries from 2016-07-10 to 1 day

CFR 688 E. The Values You Can Make ( DP )

Problem - E - Codeforces dp[ i ][ j ][ k ]: possible or not to make value k, out of a set with sum j, examining the first i coins in the array. dp[ i ][ j ][ k ] = dp[ i - 1 ][ j ][ k ] or dp[ i - 1 ][ j - C[ i ] ][ k ] or dp[ i - 1 ][ j -…

CFR 688 D. Remainders Game ( Chinese Remainder Theorem )

Problem - D - Codeforces According to the CRT, we have the conclusion that x % M = resolute value, if all values x % m[ i ] are known, where m[ i ] are all co-prime, and PRODUCT( m[ * ] ) = M. It is obvious that knowing x % p, where p % q …

CFR 688 C. NP-Hard Problem ( Bipartite Coloring )

Problem - C - Codeforces It's not difficult to see that only a bipartite graph will meet the requirements. bool dfs( int u, const vvi &G, vi &col ){ for( int v : G[ u ] ){ if( col[ v ] && col[ u ] == col[ v ] ) return false; if( !col[ v ] …