제출 #233424

#제출 시각아이디문제언어결과실행 시간메모리
233424crossing0ver코끼리 (Dancing Elephants) (IOI11_elephants)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "elephants.h"
using namespace std;
int n,L,P[100000];

void init(int N, int L1, int X[])
{
  n = N; L = L1; 
  for (int i = 0; i < n; i++) P[i+1] = X[i],s.insert(X[i]);
  
}
multiset<int> s;

int update(int i, int y)
{
	i++;
  s.erase(s.find(P[i]));
  s.insert(y);
  P[i] = y;
  int last = INT_MIN,ans = 0;
  for (auto it = s.begin(); it != s.end(); it++) {
  	if (*it > last + L)
  		ans++, last = *it;
  }
  	
  return ans;
}

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

elephants.cpp: In function 'void init(int, int, int*)':
elephants.cpp:9:45: error: 's' was not declared in this scope
   for (int i = 0; i < n; i++) P[i+1] = X[i],s.insert(X[i]);
                                             ^