[Offer收割]编程练习赛49 register

Ended

Participants:177

Verdict:Accepted
Score:100 / 100
Submitted:2018-03-04 13:35:23

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <bits/stdc++.h>
using namespace std;
const int N = 100;
const int MAX = 2 * N * 100 + 2;
int a[N + 5][N + 5], dp[N + 5][N + 5][2 * N + 5][2], cost[N + 5];
int main() {
  cost[1] = 1;
  for (int i = 2; i <= N; ++i) {
    cost[i] = min(MAX, cost[i - 1] << 1);
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= n; ++j) {
      for (int k = 0; k <= 2 * n; ++k) {
        dp[i][j][k][0] = dp[i][j][k][1] = MAX;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (i == 1 && j == 1) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX