Submission #46287847


Source Code Expand

#include <string>
#include <iostream>

using namespace std;

int main(){
  
  string s;
  cin >> s;

  for (int i = 1; i < s.size(); i += 2){
    if (s.compare(i, 1, "0") != 0){
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}

Submission Info

Submission Time
Task A - Weak Beats
User ThousandthStar
Language C++ 17 (gcc 12.2)
Score 100
Code Size 278 Byte
Status AC
Exec Time 1 ms
Memory 3676 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:11:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   11 |   for (int i = 1; i < s.size(); i += 2){
      |                   ~~^~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 23
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3400 KiB
example_01.txt AC 1 ms 3544 KiB
example_02.txt AC 1 ms 3548 KiB
hand_00.txt AC 1 ms 3532 KiB
hand_01.txt AC 1 ms 3588 KiB
hand_02.txt AC 1 ms 3484 KiB
hand_03.txt AC 1 ms 3480 KiB
hand_04.txt AC 1 ms 3400 KiB
hand_05.txt AC 1 ms 3496 KiB
hand_06.txt AC 1 ms 3676 KiB
hand_07.txt AC 1 ms 3464 KiB
hand_08.txt AC 1 ms 3552 KiB
hand_09.txt AC 1 ms 3520 KiB
random_00.txt AC 1 ms 3676 KiB
random_01.txt AC 1 ms 3468 KiB
random_02.txt AC 1 ms 3468 KiB
random_03.txt AC 1 ms 3460 KiB
random_04.txt AC 1 ms 3544 KiB
random_05.txt AC 1 ms 3460 KiB
random_06.txt AC 1 ms 3524 KiB
random_07.txt AC 1 ms 3676 KiB
random_08.txt AC 1 ms 3512 KiB
random_09.txt AC 1 ms 3524 KiB