답안 #975431

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
975431 2024-05-05T06:55:10 Z vjudge1 Awesome Arrowland Adventure (eJOI19_adventure) C++
0 / 100
1 ms 604 KB
#include <iostream>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    if(n==1&& m==1){
        cout<<0;
        return 0;
    }
        string s;

    if(n==1){
        cin>>s;
        int ans=0;
        for (int i = 0; i < s.length()-1; i++)
        {
            if(s[i]=='X'){
                cout<<-1;
                return 0;
        }
        }
        
    }
    cout<<s.length();
    return 0;
}

Compilation message

adventure.cpp: In function 'int main()':
adventure.cpp:15:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |         for (int i = 0; i < s.length()-1; i++)
      |                         ~~^~~~~~~~~~~~~~
adventure.cpp:14:13: warning: unused variable 'ans' [-Wunused-variable]
   14 |         int ans=0;
      |             ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -