제출 #781614

#제출 시각아이디문제언어결과실행 시간메모리
781614Dakto코끼리 (Dancing Elephants) (IOI11_elephants)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "elephants.h" int n; int l; vector<int> v; vector<int> ind; void init(int N, int L, int X[]) { n = N; l=L; int.resize(n); for(int i=0; i<n; i++){ v.push_back(X[i]); ind[i]=X[i]; } sort(v.begin(), v.end()); } int update(int i, int y) { v.erase(lower_bound(v.begin(), v.end(), ind[i])); ind[i]=y; v.insert(lower_bound(v.begin(), v.end(), ind[i]), ind[i]); int res=0; long long last=-100000000; for(auto i:v){ if(i>last){ last=i+l; res++; } } return res; }

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

elephants.cpp: In function 'void init(int, int, int*)':
elephants.cpp:17:6: error: expected unqualified-id before '.' token
   17 |   int.resize(n);
      |      ^