QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#494631#8549. The GameZhangYiDeCompile Error//C++98587b2024-07-27 16:23:262024-07-27 16:23:26

Details

answer.code: In function ‘int main()’:
answer.code:24:20: error: ISO C++ forbids declaration of ‘t’ with no type [-fpermissive]
   24 |         for (auto& t : p){
      |                    ^
answer.code:24:24: warning: range-based ‘for’ loops only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   24 |         for (auto& t : p){
      |                        ^
answer.code:24:24: error: forming reference to reference type ‘std::map<int, int>&’
answer.code:25:19: error: request for member ‘second’ in ‘t’, which is of non-class type ‘int’
   25 |             if (t.second)
      |                   ^~~~~~
answer.code:26:26: error: request for member ‘second’ in ‘t’, which is of non-class type ‘int’
   26 |                 sum += t.second - 1;
      |                          ^~~~~~
answer.code:28:23: error: ‘puts’ was not declared in this scope
   28 |         if (sum == n) puts("Qingyu");
      |                       ^~~~
answer.code:29:26: error: ‘puts’ was not declared in this scope
   29 |         else if(sum < n) puts("Kevin");
      |                          ^~~~