답안 #291381

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
291381 2020-09-05T08:33:12 Z Badrangiikh 동굴 (IOI13_cave) C++14
컴파일 오류
0 ms 0 KB
#include "cave.h"
#include<bits/stdc++.h>
using namespace std;

int x , y , z ;
int w [ 14 ] [ 5000 ] 
int F [ 5000 ] ;

void exploreCave(int N) {
    for ( int i = 0 ; i < 14 ; i ++ ) {
        for ( int j = 0 ; j < N ; j ++ ) {
            if ( ( 1 << i ) & j ) w [ i ] [ j ] = 1 ;
        }
    }
    for ( int i = 0 ; i < N ; i ++ ) {
        x = 0 ;
        y = tryCombination ( w [ 13 ] ) ;
        if ( y == i ) z = 1 ;
        else z = 0 ;
        for ( int j = 0 ; j < 13 ; j ++ ) {
            y = tryCombination ( w [ j ] ) ;
            if ( y == i && z == 0 ) x += 1 << j ;
            if ( y != i && z != 0 ) x += 1 << j ;
        }
        for ( int j = 0 ; j < 14 ; j ++ ) {
            w [ j ] [ x ] = z ;
        }
        F [ x ] = i ;
    }
    answer ( w [ 0 ] , F ) ;
}

Compilation message

cave.cpp:7:1: error: expected initializer before 'int'
    7 | int F [ 5000 ] ;
      | ^~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:12:35: error: 'w' was not declared in this scope
   12 |             if ( ( 1 << i ) & j ) w [ i ] [ j ] = 1 ;
      |                                   ^
cave.cpp:17:30: error: 'w' was not declared in this scope
   17 |         y = tryCombination ( w [ 13 ] ) ;
      |                              ^
cave.cpp:28:9: error: 'F' was not declared in this scope
   28 |         F [ x ] = i ;
      |         ^
cave.cpp:30:14: error: 'w' was not declared in this scope
   30 |     answer ( w [ 0 ] , F ) ;
      |              ^
cave.cpp:30:24: error: 'F' was not declared in this scope
   30 |     answer ( w [ 0 ] , F ) ;
      |                        ^