제출 #238831

#제출 시각아이디문제언어결과실행 시간메모리
238831michao동굴 (IOI13_cave)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> //#include "cave.h" #define ll long long int #define mp make_pair #define pb push_back #define ld long double #define pii pair<int,int> #define sz(x) (int)x.size() #define piii pair<pii,pii> #define precise cout<<fixed<<setprecision(10) #define st first #define nd second #define ins insert #define vi vector<int> #define BOOST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) using namespace std; void get(int n) { for (int i=0;i<n;i++)pom[i]=arr[i]; } void exploreCave(int n) { int arr[n]; vi pom=arr; int perm[n]; for (int i=0;i<n;i++)arr[i]=-1,perm[i]=-1; int x=0; for (int door=0;door<n;door++) { get(n); int bit=1; for (int i=0;i<n;i++) if (perm[i]!=-1)pom[i]=1; int y=tryCombination(pom); if (y<=x)bit^=1; int ip=0,ik=n-1; while (ip+1<ik) { int mid=(ip+ik)>>1; get(n); for (int i=0;i<=mid;i++)pom[i]=bit; y=tryCombination(pom); if (y>x)ik=mid; else ip=mid; } perm[ip+1]=door,arr[ip+1]=bit; x++; } answer(arr,perm); }

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

cave.cpp: In function 'void get(int)':
cave.cpp:19:23: error: 'pom' was not declared in this scope
  for (int i=0;i<n;i++)pom[i]=arr[i];
                       ^~~
cave.cpp:19:23: note: suggested alternative: 'pow'
  for (int i=0;i<n;i++)pom[i]=arr[i];
                       ^~~
                       pow
cave.cpp:19:30: error: 'arr' was not declared in this scope
  for (int i=0;i<n;i++)pom[i]=arr[i];
                              ^~~
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:24:9: error: conversion from 'int [n]' to non-scalar type 'std::vector<int>' requested
  vi pom=arr;
         ^~~
cave.cpp:33:10: error: 'tryCombination' was not declared in this scope
    int y=tryCombination(pom);
          ^~~~~~~~~~~~~~
cave.cpp:48:2: error: 'answer' was not declared in this scope
  answer(arr,perm);
  ^~~~~~
cave.cpp:48:2: note: suggested alternative: 'assert'
  answer(arr,perm);
  ^~~~~~
  assert