QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#389441#7990. 广播O_start#Compile Error//C++14993b2024-04-14 13:35:272024-04-14 13:35:27

Judging History

你现在查看的是最新测评结果

  • [2024-04-14 13:35:27]
  • 评测
  • [2024-04-14 13:35:27]
  • 提交

answer

#include<iostream>
using namespace std;
int m, n;
int p[2005];
int q[2005];
int dp[2005][2005];

int f(int tl_p, int tl_q){
    if(tl_p < 0 || tl_q < 0){
        return 0;
    }
    if(dp[tl_p][tl_q] != -1){
        return dp[tl_p][tl_q];
    }
    if(p[tl_p] == q[tl_q] || p[tl_p] == 1 || q[tl_q] == 1){
        dp[tl_p][tl_q] = f(tl_p - 1, tl_q - 1);
        return dp[tl_p][tl_q];
    }
    else{
        dp[tl_p][tl_q] = min(f(tl_p - 1, tl_q), f(tl_p, tl_q - 1)) + 1;
        return dp[tl_p][tl_q];
    }
}

void solve(){
    for(int i = 0;i < m;i++){
        for(int j = 0;j < n;j++){
            dp[i][j] = -1;
        }
    }
    int ans = f(m - 1, n - 1);
    cout << ans << endl;
}

int main(){
    cin >> m >> n;
    for(int i = 0;i < m;i++){
        cin >> p[i];
    }
    for(int i = 0;i < n;i++){
        cin >> q[i];
    }
    solve();
    return 0;
}

Details

answer.code:9:1: error: extended character   is not valid in an identifier
    9 |     if(tl_p < 0 || tl_q < 0){
      | ^
answer.code:9:3: error: extended character   is not valid in an identifier
    9 |     if(tl_p < 0 || tl_q < 0){
      |   ^
answer.code:10:1: error: extended character   is not valid in an identifier
   10 |         return 0;
      | ^
answer.code:10:3: error: extended character   is not valid in an identifier
   10 |         return 0;
      |   ^
answer.code:10:5: error: extended character   is not valid in an identifier
   10 |         return 0;
      |     ^
answer.code:10:7: error: extended character   is not valid in an identifier
   10 |         return 0;
      |       ^
answer.code:11:1: error: extended character   is not valid in an identifier
   11 |     }
      | ^
answer.code:11:3: error: extended character   is not valid in an identifier
   11 |     }
      |   ^
answer.code:12:1: error: extended character   is not valid in an identifier
   12 |     if(dp[tl_p][tl_q] != -1){
      | ^
answer.code:12:3: error: extended character   is not valid in an identifier
   12 |     if(dp[tl_p][tl_q] != -1){
      |   ^
answer.code:13:1: error: extended character   is not valid in an identifier
   13 |         return dp[tl_p][tl_q];
      | ^
answer.code:13:3: error: extended character   is not valid in an identifier
   13 |         return dp[tl_p][tl_q];
      |   ^
answer.code:13:5: error: extended character   is not valid in an identifier
   13 |         return dp[tl_p][tl_q];
      |     ^
answer.code:13:7: error: extended character   is not valid in an identifier
   13 |         return dp[tl_p][tl_q];
      |       ^
answer.code:14:1: error: extended character   is not valid in an identifier
   14 |     }
      | ^
answer.code:14:3: error: extended character   is not valid in an identifier
   14 |     }
      |   ^
answer.code:15:1: error: extended character   is not valid in an identifier
   15 |     if(p[tl_p] == q[tl_q] || p[tl_p] == 1 || q[tl_q] == 1){
      | ^
answer.code:15:3: error: extended character   is not valid in an identifier
   15 |     if(p[tl_p] == q[tl_q] || p[tl_p] == 1 || q[tl_q] == 1){
      |   ^
answer.code:16:1: error: extended character   is not valid in an identifier
   16 |         dp[tl_p][tl_q] = f(tl_p - 1, tl_q - 1);
      | ^
answer.code:16:3: error: extended character   is not valid in an identifier
   16 |         dp[tl_p][tl_q] = f(tl_p - 1, tl_q - 1);
      |   ^
answer.code:16:5: error: extended character   is not valid in an identifier
   16 |         dp[tl_p][tl_q] = f(tl_p - 1, tl_q - 1);
      |     ^
answer.code:16:7: error: extended character   is not valid in an identifier
   16 |         dp[tl_p][tl_q] = f(tl_p - 1, tl_q - 1);
      |       ^
answer.code:17:1: error: extended character   is not valid in an identifier
   17 |         return dp[tl_p][tl_q];
      | ^
answer.code:17:3: error: extended character   is not valid in an identifier
   17 |         return dp[tl_p][tl_q];
      |   ^
answer.code:17:5: error: extended character   is not valid in an identifier
   17 |         return dp[tl_p][tl_q];
      |     ^
answer.code:17:7: error: extended character   is not valid in an identifier
   17 |         return dp[tl_p][tl_q];
      |       ^
answer.code:18:1: error: extended character   is not valid in an identifier
   18 |     }
      | ^
answer.code:18:3: error: extended character   is not valid in an identifier
   18 |     }
      |   ^
answer.code:19:1: error: extended character   is not valid in an identifier
   19 |     else{
      | ^
answer.code:19:3: error: extended character   is not valid in an identifier
   19 |     else{
      |   ^
answer.code:20:1: error: extended character   is not valid in an identifier
   20 |         dp[tl_p][tl_q] = min(f(tl_p - 1, tl_q), f(tl_p, tl_q - 1)) + 1;
      | ^
answer.code:20:3: error: extended character   is not valid in an identifier
   20 |         dp[tl_p][tl_q] = min(f(tl_p - 1, tl_q), f(tl_p, tl_q - 1)) + 1;
      |   ^
answer.code:20:5: error: extended character   is not valid in an identifier
   20 |         dp[tl_p][tl_q] = min(f(tl_p - 1, tl_q), f(tl_p, tl_q - 1)) + 1;
      |     ^
answer.code:20:7: error: extended character   is not valid in an identifier
   20 |         dp[tl_p][tl_q] = min(f(tl_p - 1, tl_q), f(tl_p, tl_q - 1)) + 1;
      |       ^
answer.code:21:1: error: extended character   is not valid in an identifier
   21 |         return dp[tl_p][tl_q];
      | ^
answer.code:21:3: error: extended character   is not valid in an identifier
   21 |         return dp[tl_p][tl_q];
      |   ^
answer.code:21:5: error: extended character   is not valid in an identifier
   21 |         return dp[tl_p][tl_q];
      |     ^
answer.code:21:7: error: extended character   is not valid in an identifier
   21 |         return dp[tl_p][tl_q];
      |       ^
answer.code:22:1: error: extended character   is not valid in an identifier
   22 |     }
      | ^
answer.code:22:3: error:...