답안 #499731

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
499731 2021-12-29T10:59:55 Z martarel 슈퍼트리 잇기 (IOI20_supertrees) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include<algorithm>
#include <math.h> 
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pi;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll maxn = 2e5 + 100;
const ll INF = 1e9;
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pii pair<ll, pair<int, int>>
#define mp make_pair
#define f first
#define s second
#define all(x) (x).begin(), (x).end()
#define FOR(n) for(int i = 0; i < n; i++)

void build(int[][] b){
  
}

int construct(int[][] p){
  n = (sizeof(p)/sizeof(*p));
  int[n][n] ans;
  //Case 1
  for (int i = 1; i < n; i++){
    ans[0][i] = 1;
    ans[i][0] = 1;
  }
  build(ans);
  return 1;
}

Compilation message

supertrees.cpp:22:18: error: multidimensional array must have bounds for all dimensions except the first
   22 | void build(int[][] b){
      |                  ^
supertrees.cpp:22:20: error: expected ',' or '...' before 'b'
   22 | void build(int[][] b){
      |                    ^
supertrees.cpp:26:21: error: multidimensional array must have bounds for all dimensions except the first
   26 | int construct(int[][] p){
      |                     ^
supertrees.cpp:26:23: error: expected ',' or '...' before 'p'
   26 | int construct(int[][] p){
      |                       ^
supertrees.cpp: In function 'int construct()':
supertrees.cpp:27:3: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |   n = (sizeof(p)/sizeof(*p));
      |   ^
      |   yn
supertrees.cpp:27:15: error: 'p' was not declared in this scope; did you mean 'pi'?
   27 |   n = (sizeof(p)/sizeof(*p));
      |               ^
      |               pi
supertrees.cpp:28:6: error: structured binding declaration cannot have type 'int'
   28 |   int[n][n] ans;
      |      ^~~
supertrees.cpp:28:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
supertrees.cpp:28:9: error: expected initializer before '[' token
   28 |   int[n][n] ans;
      |         ^
supertrees.cpp:31:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |     ans[0][i] = 1;
      |     ^~~
      |     abs
supertrees.cpp:34:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |   build(ans);
      |         ^~~
      |         abs
supertrees.cpp:28:6: warning: unused structured binding declaration [-Wunused-variable]
   28 |   int[n][n] ans;
      |      ^~~