Submission #730582

#TimeUsernameProblemLanguageResultExecution timeMemory
7305821075508020060209tcLamps (JOI19_lamps)C++14
4 / 100
55 ms6208 KiB
//#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 (stderr)

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'){
      |               ~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...