제출 #1354491

#제출 시각아이디문제언어결과실행 시간메모리
1354491ppmn_6Casino (JOI26_casino)C++20
컴파일 에러
0 ms0 KiB
#include "Azzurro.h"
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;

vector<vector<int>> Azzurro(int n, int l, string s) {
  vector<vector<int>> ret(n, vector<int>(n, 0));
  if (l > 33) {
    return ret;
  }
  int cur = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1 || cur == l) {
      continue;
    }
    for (int j = 0; j < n; j++) {
      if (s[cur] == 'B') {
        ret[i][j] = 1;
      }
      cur++;
      if (cur == l) {
        break;
      }
    }
  }
  if (cur < l) {
    ret[n - 1][n - 1] = s[cur] == 'B' ? 1 : 0;
  }
  return ret;
}
#include "Bordeaux.h"
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;

vector<vector<int>> Bordeaux(int n, int l, vector<vector<int>> t) {
  string ans(l, 'A');
  if (l > 33) {
    return ans;
  }
  int cur = 0;
  for (int i = 1; i < n; i += 2) {
    int lb = -1, rb = -1;
    for (int j = 0; j < n; j++) {
      if (t[i][j] && lb == -1) {
        lb = j;
      }
      if (!t[i][j] && lb != -1) {
        break;
      }
      if (lb != -1) {
        rb = j;
      }
    }
    if (lb == -1) {
      lb = n - 1;
    }
    for (int j = cur; j <= lb; j++) {
      t[i - 1][j] = 1 - t[i - 1][j];
    }
    cur = rb;
  }
  t[n - 1][n - 1] = 1 - t[n - 1][n - 1];
  cur = 0;
  for (int i = 0; i < n; i++) {
    if (i & 1 || cur == l) {
      continue;
    }
    for (int j = 0; j < n; j++) {
      if (t[i][j]) {
        ans[cur] = 'B';
      }
      cur++;
      if (cur == l) {
        break;
      }
    }
  }
  if (cur < l) {
    ans[cur] = t[n - 1][n - 1] ? 'B' : 'A';
  }
  return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

# 2번째 컴파일 단계

Bordeaux.cpp:8:21: error: ambiguating new declaration of 'std::vector<std::vector<int> > Bordeaux(int, int, std::vector<std::vector<int> >)'
    8 | vector<vector<int>> Bordeaux(int n, int l, vector<vector<int>> t) {
      |                     ^~~~~~~~
In file included from Bordeaux.cpp:1:
Bordeaux.h:4:13: note: old declaration 'std::string Bordeaux(int, int, std::vector<std::vector<int> >)'
    4 | std::string Bordeaux(int N, int L, std::vector<std::vector<int>> T);
      |             ^~~~~~~~
Bordeaux.cpp: In function 'std::vector<std::vector<int> > Bordeaux(int, int, std::vector<std::vector<int> >)':
Bordeaux.cpp:11:12: error: could not convert 'ans' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<std::vector<int> >'
   11 |     return ans;
      |            ^~~
      |            |
      |            std::string {aka std::__cxx11::basic_string<char>}
Bordeaux.cpp:54:10: error: could not convert 'ans' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<std::vector<int> >'
   54 |   return ans;
      |          ^~~
      |          |
      |          std::string {aka std::__cxx11::basic_string<char>}