QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#852728#9925. LR StringZhangYiDeCompile Error//C++202.4kb2025-01-11 13:42:502025-01-11 13:42:55

詳細信息

answer.code:32:26: error: ‘std::vector<std::vector<int> > index’ redeclared as different kind of entity
   32 | vector<vector<int>> index(256);
      |                          ^
In file included from /usr/include/string.h:432,
                 from /usr/include/c++/13/cstring:42,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:121,
                 from answer.code:1:
/usr/include/strings.h:61:1: note: previous declaration ‘const char* index(const char*, int)’
   61 | index (const char *__s, int __c) __THROW
      | ^~~~~
answer.code: In function ‘void init(std::string&)’:
answer.code:35:33: error: invalid types ‘<unresolved overloaded function type>[int]’ for array subscript
   35 |     for(int i=0;i<256;++i) index[i].clear();
      |                                 ^
answer.code:40:14: error: invalid types ‘<unresolved overloaded function type>[char]’ for array subscript
   40 |         index[c].push_back(i);  // ??push_back??add
      |              ^
answer.code: In function ‘bool isSubsequence(std::string&, std::string&)’:
answer.code:52:18: error: invalid types ‘<unresolved overloaded function type>[char]’ for array subscript
   52 |         if (index[c].empty()) return false;  // ??empty()??vector????
      |                  ^
answer.code:53:35: error: invalid types ‘<unresolved overloaded function type>[char]’ for array subscript
   53 |         int pos = left_bound(index[c], j);
      |                                   ^
answer.code:55:25: error: invalid types ‘<unresolved overloaded function type>[char]’ for array subscript
   55 |         if (pos == index[c].size()) return false;
      |                         ^
answer.code:57:18: error: invalid types ‘<unresolved overloaded function type>[char]’ for array subscript
   57 |         j = index[c][pos] + 1;  // ??[]??get
      |                  ^