답안 #730582

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
730582 2023-04-26T06:33:10 Z 1075508020060209tc Lamps (JOI19_lamps) C++14
4 / 100
55 ms 6208 KB
//#include "lib2249.h"
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
string A;
string B;

signed main(){
cin>>n>>A>>B;
int ans=0;
for(int i=0;i<B.size();i++){
    if(B[i]=='1'){
        while(i+1<B.size()&&B[i+1]=='1'){
            i++;
        }
        ans++;
    }
}
cout<<ans<<endl;

}

Compilation message

lamp.cpp: In function 'int main()':
lamp.cpp:12:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 | for(int i=0;i<B.size();i++){
      |             ~^~~~~~~~~
lamp.cpp:14:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |         while(i+1<B.size()&&B[i+1]=='1'){
      |               ~~~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 42 ms 6064 KB Output is correct
8 Correct 44 ms 6004 KB Output is correct
9 Correct 49 ms 6208 KB Output is correct
10 Correct 43 ms 5996 KB Output is correct
11 Correct 47 ms 6148 KB Output is correct
12 Correct 55 ms 6112 KB Output is correct
13 Correct 42 ms 6064 KB Output is correct
14 Correct 45 ms 6068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -