Submission #446738

#TimeUsernameProblemLanguageResultExecution timeMemory
446738fuad27Awesome Arrowland Adventure (eJOI19_adventure)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int main () { int n, m, s; cin>>n>>m>>s; for(int i=0;i<s.size()-1;i++){ if(s[i]=='X'){ cout<<-1<<endl; return 0; } } cout<<0<<endl; }

Compilation message (stderr)

adventure.cpp: In function 'int main()':
adventure.cpp:6:18: error: request for member 'size' in 's', which is of non-class type 'int'
    6 |  for(int i=0;i<s.size()-1;i++){
      |                  ^~~~
adventure.cpp:7:7: error: invalid types 'int[int]' for array subscript
    7 |   if(s[i]=='X'){
      |       ^