Submission #43186

#TimeUsernameProblemLanguageResultExecution timeMemory
43186jwvg0425즐거운 사진 수집 (JOI13_collecting)C++14
Compilation error
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; };

Compilation message (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())
              ^