QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#694906#9423. Gold MedalZhangYiDeCompile Error//C++11602b2024-10-31 18:55:082024-10-31 18:55:08

Details

answer.code:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include&lt;bits/stdc++.h&gt;
      |         ^
answer.code: In function ‘void solve()’:
answer.code:10:17: error: ‘cin’ was not declared in this scope
   10 |         int n,k;cin&gt;&gt;n&gt;&gt;k;
      |                 ^~~
answer.code:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
  +++ |+#include <iostream>
    1 | #include&lt;bits/stdc++.h&gt;
answer.code:10:21: error: ‘gt’ was not declared in this scope
   10 |         int n,k;cin&gt;&gt;n&gt;&gt;k;
      |                     ^~
answer.code:4:37: error: ‘lt’ was not declared in this scope
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                                     ^~
answer.code:13:9: note: in expansion of macro ‘rep’
   13 |         rep(i,1,n) {
      |         ^~~
answer.code:4:40: error: expected primary-expression before ‘=’ token
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                                        ^
answer.code:13:9: note: in expansion of macro ‘rep’
   13 |         rep(i,1,n) {
      |         ^~~
answer.code:4:43: error: expected ‘)’ before ‘;’ token
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                       ~                   ^
answer.code:13:9: note: in expansion of macro ‘rep’
   13 |         rep(i,1,n) {
      |         ^~~
answer.code:13:13: error: ‘i’ was not declared in this scope
   13 |         rep(i,1,n) {
      |             ^
answer.code:4:44: note: in definition of macro ‘rep’
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                                            ^
answer.code:21:9: error: ‘sort’ was not declared in this scope; did you mean ‘short’?
   21 |         sort(b+1,b+1+n);
      |         ^~~~
      |         short
answer.code:4:37: error: ‘lt’ was not declared in this scope
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                                     ^~
answer.code:22:9: note: in expansion of macro ‘rep’
   22 |         rep(i,1,n){
      |         ^~~
answer.code:4:40: error: expected primary-expression before ‘=’ token
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                                        ^
answer.code:22:9: note: in expansion of macro ‘rep’
   22 |         rep(i,1,n){
      |         ^~~
answer.code:4:43: error: expected ‘)’ before ‘;’ token
    4 | #define rep(i,a,b) for(int i = a;i &lt;= b;i++)
      |                       ~                   ^
answer.code:22:9: note: in expansion of macro ‘rep’
   22 |         rep(i,1,n){
      |         ^~~
answer.code:29:9: error: ‘cout’ was not declared in this scope
   29 |         cout&lt;&lt;ans&lt;&lt;endl;
      |         ^~~~
answer.code:29:9: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answer.code:29:14: error: ‘lt’ was not declared in this scope
   29 |         cout&lt;&lt;ans&lt;&lt;endl;
      |              ^~
answer.code:29:32: error: ‘endl’ was not declared in this scope
   29 |         cout&lt;&lt;ans&lt;&lt;endl;
      |                                ^~~~
answer.code:1:1: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?
  +++ |+#include <ostream>
    1 | #include&lt;bits/stdc++.h&gt;
answer.code: In function ‘int main()’:
answer.code:35:9: error: ‘cin’ was not declared in this scope
   35 |         cin&gt;&gt;t;
      |         ^~~
answer.code:35:9: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answer.code:35:13: error: ‘gt’ was not declared in this scope; did you mean ‘t’?
   35 |         cin&gt;&gt;t;
      |             ^~
      |             t