답안 #202351

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
202351 2020-02-15T18:15:44 Z a_player 벽 (IOI14_wall) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;
#define fh finalHeight

cont int MAXN=1e5;
int m[MAXN][2];
int t[MAXN][2];

void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]){
    for(int i=0;i<n;i++)m[i][1]=INT_MAX;
  for(int i=0;i<k;i++){
      if(op[i]==1){
          for(int j=left[i];j<=right[i];j++){
              if(m[j][0]<=height[i]){
                  m[j][0]=height[i];
                  t[j][0]=i;
              }
          }
          
      }else{
          for(int j=left[i];j<=right[i];j++){
              if(m[j][1]>=height[i]){
                  m[j][1]=height[i];
                  t[j][1]=i;
              }
          }
      }

  }
  for(int i=0;i<n;i++){
      if(m[i][0]>=m[i][1]&&t[i][0]>t[i][1])fh[i]=m[i][0];
      if(m[i][0]>=m[i][1]&&t[i][0]<t[i][1])fh[i]=m[i][1];
      if(m[i][0]<=m[i][1])fh[i]=m[i][0];
  }
}

Compilation message

wall.cpp:6:1: error: 'cont' does not name a type; did you mean 'clone'?
 cont int MAXN=1e5;
 ^~~~
 clone
wall.cpp:7:7: error: 'MAXN' was not declared in this scope
 int m[MAXN][2];
       ^~~~
wall.cpp:7:7: note: suggested alternative: 'NAN'
 int m[MAXN][2];
       ^~~~
       NAN
wall.cpp:8:7: error: 'MAXN' was not declared in this scope
 int t[MAXN][2];
       ^~~~
wall.cpp:8:7: note: suggested alternative: 'NAN'
 int t[MAXN][2];
       ^~~~
       NAN
wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:11:25: error: 'm' was not declared in this scope
     for(int i=0;i<n;i++)m[i][1]=INT_MAX;
                         ^
wall.cpp:15:18: error: 'm' was not declared in this scope
               if(m[j][0]<=height[i]){
                  ^
wall.cpp:17:19: error: 't' was not declared in this scope
                   t[j][0]=i;
                   ^
wall.cpp:23:18: error: 'm' was not declared in this scope
               if(m[j][1]>=height[i]){
                  ^
wall.cpp:25:19: error: 't' was not declared in this scope
                   t[j][1]=i;
                   ^
wall.cpp:32:10: error: 'm' was not declared in this scope
       if(m[i][0]>=m[i][1]&&t[i][0]>t[i][1])fh[i]=m[i][0];
          ^
wall.cpp:32:28: error: 't' was not declared in this scope
       if(m[i][0]>=m[i][1]&&t[i][0]>t[i][1])fh[i]=m[i][0];
                            ^
wall.cpp:33:10: error: 'm' was not declared in this scope
       if(m[i][0]>=m[i][1]&&t[i][0]<t[i][1])fh[i]=m[i][1];
          ^
wall.cpp:33:28: error: 't' was not declared in this scope
       if(m[i][0]>=m[i][1]&&t[i][0]<t[i][1])fh[i]=m[i][1];
                            ^
wall.cpp:34:10: error: 'm' was not declared in this scope
       if(m[i][0]<=m[i][1])fh[i]=m[i][0];
          ^