제출 #43186

#제출 시각아이디문제언어결과실행 시간메모리
43186jwvg0425즐거운 사진 수집 (JOI13_collecting)C++14
컴파일 에러
0 ms0 KiB
class FenwickTree { public: FenwickTree(int k) { data.resize(k); } i64 sum(int n) { i64 ans = 0; while (n > 0) { ans += data[n]; n -= (n & -n); } return ans; } void add(int n, i64 num) { while (n < data.size()) { data[n] += num; n += (n & -n); } } private: vector<i64> data; };

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

collecting.cpp:9:2: error: 'i64' does not name a type
  i64 sum(int n)
  ^
collecting.cpp:22:18: error: 'i64' has not been declared
  void add(int n, i64 num)
                  ^
collecting.cpp:32:2: error: 'vector' does not name a type
  vector<i64> data;
  ^
collecting.cpp: In constructor 'FenwickTree::FenwickTree(int)':
collecting.cpp:6:3: error: 'data' was not declared in this scope
   data.resize(k);
   ^
collecting.cpp: In member function 'void FenwickTree::add(int, int)':
collecting.cpp:24:14: error: 'data' was not declared in this scope
   while (n < data.size())
              ^