ZOJ POJ 2260 (ZOJ 1949) Error Correction 문제 하나 A boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here’s a 4 x 4 matrix which has the parity property: 1 0 1 0 Your job is to writ... ZOJpoj 수학 법칙을 찾으면 돼요. 그다음에 정답은요. k^(m-1)*(n-(m-1)*k)+(m+(m-1)*k+1)*k^(m-1) div 2... ZOJ 고정밀 우선 우리는 두 개의 수 a, b에 대해 그들의 gcd 상황에 대해 다음과 같은 형식의 토론이 있다는 것을 안다 a가 홀수, b가 짝수일 때 gcd(a, b) = gcd(a div 2,b) b가 홀수, a가 짝수일 때 gcd(a, b) = gcd(a, b div 2) a가 짝수, b가 짝수일 때 gcd(a, b)=2*gcd(a div2, b div2) a가 홀수, b가 홀수일 때 유클리드의 ... ZOJ bzoj 2748 DP ZOJ bzoj 2121 DP 우선 만약에 우리가 i를 처리할 수 있다면 j단을 없앨 수 있습니까? 그러면 바로 dp로 옮길 수 있습니다. w[i]를 전 i로 설정하면 최소한 얼마 남았습니까? 그러면 w[i]=w[j-1](flag[j][i]). 지금 우리는flag[i][j]를 구할 수 있다. 우선 우리는 문자열 그룹을trie로 만든 다음에 직렬 L에서left 위치에서 시작하는 모든 flag를 처리할 수 있다. 그러면 우리... ZOJ bzoj 1084 DP f[i][k]를 이 행렬 전 i개의 k개 행렬의 최대 화합으로 설정하면 f[i][k]=max(f[j][k-1]+sum[j+1][i])를 설정합니다. 그러면 m=2가 m=1과 유사할 때 w[i][j][k]를 왼쪽 줄 전 i 중 오른쪽 줄 전 j 중 모두 k개의 행렬을 선택하면 최대 행렬을 선택할 수 있습니다. w[i][j][k]=max(w[i-1][j][k], w[i][j-1][k]) 이런 상... ZOJ zoj 2338 HanioTower Edition f[n][m]가 n개disc, m개peg인 Hanoi문제를 기록하면 dp공식 f[n][m]=min{f[n-k][m-1]+2*f[k][m]}가 있다.즉, 위의 k개disc를 m개peg으로 중간peg을 옮기고 아래의 n-k개disc를 m-1개peg으로 목표peg으로 옮기고 마지막으로 위의 k개disc를 m개peg으로 목표peg로 옮긴다.p프로세스는 f[n][m]... ZOJ ZOJ 3537 Cake(볼륨 판정 + 구간 DP) Here’s a polygon-shaped cake on the table. You’d like to cut the cake into several triangle-shaped parts for the invited comers. The trace of each cut is a line segment, whose two endpoints are two vertices of the polygo... dpZOJ구간DP ZOJ1463: Brackets Sequence(구간 DP) Let us define a regular brackets sequence in the following way: 1. For example, all of the following sequences of characters are regular brackets sequences: (), [], (()), ([]), ()[], ()[()] And all of the following chara... dpZOJ ZOJ3582---Back to the Past "The box can take you back to the past,"MasterO said, "so you can get any evidence you need. There are N tiny dark holes on both sides of the box (2N holes in total). Every day, for each hole, there is a possibility P to... dpZOJ bzoj 1296 DP 매 줄마다 DP 예처리를 하면 w[i][j]는 이 줄 앞에서 i개가 j회 갱신하는 최대 가치를 나타낸다. 그러면 w[i][j]=max(w[i][j], w[k][j]+sum[k+1][i]), sum[i][j]는 i-j단을 한 번에 최대 몇 개까지 갱신한다. 그러면 우리는 각 줄을 하나의 물품으로 간주할 수 있다. 전체적으로 DP를 만들면 W[i][j]는 전 i행이 j회 갱신하는 최대 가치를 나... ZOJ
POJ 2260 (ZOJ 1949) Error Correction 문제 하나 A boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here’s a 4 x 4 matrix which has the parity property: 1 0 1 0 Your job is to writ... ZOJpoj 수학 법칙을 찾으면 돼요. 그다음에 정답은요. k^(m-1)*(n-(m-1)*k)+(m+(m-1)*k+1)*k^(m-1) div 2... ZOJ 고정밀 우선 우리는 두 개의 수 a, b에 대해 그들의 gcd 상황에 대해 다음과 같은 형식의 토론이 있다는 것을 안다 a가 홀수, b가 짝수일 때 gcd(a, b) = gcd(a div 2,b) b가 홀수, a가 짝수일 때 gcd(a, b) = gcd(a, b div 2) a가 짝수, b가 짝수일 때 gcd(a, b)=2*gcd(a div2, b div2) a가 홀수, b가 홀수일 때 유클리드의 ... ZOJ bzoj 2748 DP ZOJ bzoj 2121 DP 우선 만약에 우리가 i를 처리할 수 있다면 j단을 없앨 수 있습니까? 그러면 바로 dp로 옮길 수 있습니다. w[i]를 전 i로 설정하면 최소한 얼마 남았습니까? 그러면 w[i]=w[j-1](flag[j][i]). 지금 우리는flag[i][j]를 구할 수 있다. 우선 우리는 문자열 그룹을trie로 만든 다음에 직렬 L에서left 위치에서 시작하는 모든 flag를 처리할 수 있다. 그러면 우리... ZOJ bzoj 1084 DP f[i][k]를 이 행렬 전 i개의 k개 행렬의 최대 화합으로 설정하면 f[i][k]=max(f[j][k-1]+sum[j+1][i])를 설정합니다. 그러면 m=2가 m=1과 유사할 때 w[i][j][k]를 왼쪽 줄 전 i 중 오른쪽 줄 전 j 중 모두 k개의 행렬을 선택하면 최대 행렬을 선택할 수 있습니다. w[i][j][k]=max(w[i-1][j][k], w[i][j-1][k]) 이런 상... ZOJ zoj 2338 HanioTower Edition f[n][m]가 n개disc, m개peg인 Hanoi문제를 기록하면 dp공식 f[n][m]=min{f[n-k][m-1]+2*f[k][m]}가 있다.즉, 위의 k개disc를 m개peg으로 중간peg을 옮기고 아래의 n-k개disc를 m-1개peg으로 목표peg으로 옮기고 마지막으로 위의 k개disc를 m개peg으로 목표peg로 옮긴다.p프로세스는 f[n][m]... ZOJ ZOJ 3537 Cake(볼륨 판정 + 구간 DP) Here’s a polygon-shaped cake on the table. You’d like to cut the cake into several triangle-shaped parts for the invited comers. The trace of each cut is a line segment, whose two endpoints are two vertices of the polygo... dpZOJ구간DP ZOJ1463: Brackets Sequence(구간 DP) Let us define a regular brackets sequence in the following way: 1. For example, all of the following sequences of characters are regular brackets sequences: (), [], (()), ([]), ()[], ()[()] And all of the following chara... dpZOJ ZOJ3582---Back to the Past "The box can take you back to the past,"MasterO said, "so you can get any evidence you need. There are N tiny dark holes on both sides of the box (2N holes in total). Every day, for each hole, there is a possibility P to... dpZOJ bzoj 1296 DP 매 줄마다 DP 예처리를 하면 w[i][j]는 이 줄 앞에서 i개가 j회 갱신하는 최대 가치를 나타낸다. 그러면 w[i][j]=max(w[i][j], w[k][j]+sum[k+1][i]), sum[i][j]는 i-j단을 한 번에 최대 몇 개까지 갱신한다. 그러면 우리는 각 줄을 하나의 물품으로 간주할 수 있다. 전체적으로 DP를 만들면 W[i][j]는 전 i행이 j회 갱신하는 최대 가치를 나... ZOJ