답안 #1014125

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1014125 2024-07-04T11:45:45 Z Ahmed_Solyman 슈퍼트리 잇기 (IOI20_supertrees) C++14
컴파일 오류
0 ms 0 KB
/*
In the name of Allah
made by: Ahmed_Solyman
*/
#include <bits/stdc++.h>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("-O1")
//-------------------------------------------------------------//
typedef long long ll;
typedef unsigned long long ull;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define PI acos(-1)
#define lb lower_bound
#define ub upper_bound
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define sum_to(n) (n*(n+1))/2
#define pb push_back
#define pf push_front
#define fil(arr,x) memset(arr,x,sizeof(arr))
#define endl '\n'
const ll mod=1e9+7;
int dx[8]={0,1,0,-1,1,1,-1,-1};
int dy[8]={1,0,-1,0,1,-1,-1,1};
//-------------------------------------------------------------//
ll lcm(ll a,ll b)
{
    return (max(a,b)/__gcd(a,b))*min(a,b);
}
void person_bool(bool x)
{
    cout<<(x?"YES":"NO")<<endl;
}
void build(int b[][]);
int construct(int[][] p){
    int n=0;
    for(auto i:p)n++;
    int b[n][n];
    for(int i=0;i<n-1;i++){
        b[i][i+1]=b[i+1][i]=1;
    }
    build(b);
    return 1;
}

Compilation message

supertrees.cpp:38:16: error: declaration of 'b' as multidimensional array must have bounds for all dimensions except the first
   38 | void build(int b[][]);
      |                ^
supertrees.cpp:39:21: error: multidimensional array must have bounds for all dimensions except the first
   39 | int construct(int[][] p){
      |                     ^
supertrees.cpp:39:23: error: expected ',' or '...' before 'p'
   39 | int construct(int[][] p){
      |                       ^
supertrees.cpp: In function 'int construct()':
supertrees.cpp:41:16: error: 'p' was not declared in this scope
   41 |     for(auto i:p)n++;
      |                ^