A. Div. 64

Codeforces
IDCF887A
Time1000ms
Memory256MB
Difficulty
implementation
English · Original
Chinese · Translation
Formal · Original
Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is following: for given string, consisting of only 0 and 1, tell if it's possible to remove some digits in such a way, that remaining number is a representation of some positive integer, divisible by 64, in the binary numerical system. ## Input In the only line given a non-empty binary string _s_ with length up to 100. ## Output Print «_yes_» (without quotes) if it's possible to remove digits required way and «_no_» otherwise. [samples] ## Note In the first test case, you can get string 1 000 000 after removing two ones which is a representation of number 64 in the binary numerical system. You can read more about binary numeral system representation here: [https://en.wikipedia.org/wiki/Binary_system](https://en.wikipedia.org/wiki/Binary_system)
顶级模特 Izabella 参加了一场竞赛。她希望给评委留下深刻印象,并展示她的数学能力。 她的题目如下:给定一个仅由 0 和 1 组成的字符串,判断是否可以通过移除某些数字,使得剩余的数字是某个能被 64 整除的正整数的二进制表示。 在唯一的一行中,给定一个非空的二进制字符串 #cf_span[s],长度不超过 #cf_span[100]。 如果可以通过移除数字实现上述要求,请输出 «_yes_»(不含引号),否则输出 «_no_»。 在第一个测试用例中,你可以通过移除两个 1 得到字符串 #cf_span[1 000 000],它是二进制系统中数字 #cf_span[64] 的表示。 你可以在这里了解更多关于二进制数系统表示的信息:https://en.wikipedia.org/wiki/Binary_system ## Input 在唯一的一行中,给定一个非空的二进制字符串 #cf_span[s],长度不超过 #cf_span[100]。 ## Output 如果可以通过移除数字实现上述要求,请输出 «_yes_»(不含引号),否则输出 «_no_»。 [samples] ## Note 在第一个测试用例中,你可以通过移除两个 1 得到字符串 #cf_span[1 000 000],它是二进制系统中数字 #cf_span[64] 的表示。你可以在这里了解更多关于二进制数系统表示的信息:https://en.wikipedia.org/wiki/Binary_system
Given a binary string $ s \in \{0,1\}^* $ with $ 1 \leq |s| \leq 100 $, determine whether there exists a subsequence of $ s $ that forms a binary representation of a positive integer divisible by 64. A binary string represents a positive integer divisible by 64 if and only if it is non-empty, does not have leading zeros (except for the single digit "0", which is not allowed since the integer must be positive), and its last six digits are all zeros (since $ 64 = 2^6 $). Thus, the problem reduces to: Does there exist a subsequence of $ s $ of the form $ b \, 000000 $, where $ b \in \{1\} \cup \{1\}\{0,1\}^* $ (i.e., a non-empty binary string ending in six zeros and starting with a '1')? Equivalently: Does $ s $ contain at least one '1' followed (not necessarily consecutively) by six '0's?
Samples
Input #1
100010001
Output #1
yes
Input #2
100
Output #2
no
API Response (JSON)
{
  "problem": {
    "name": "A. Div. 64",
    "description": {
      "content": "Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is following: for given string, consisting of only 0 and 1, tell if it's ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF887A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills.\n\nHer problem is following: for given string, consisting of only 0 and 1, tell if it's ...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "顶级模特 Izabella 参加了一场竞赛。她希望给评委留下深刻印象,并展示她的数学能力。\n\n她的题目如下:给定一个仅由 0 和 1 组成的字符串,判断是否可以通过移除某些数字,使得剩余的数字是某个能被 64 整除的正整数的二进制表示。\n\n在唯一的一行中,给定一个非空的二进制字符串 #cf_span[s],长度不超过 #cf_span[100]。\n\n如果可以通过移除数字实现上述要求,请输出 «_y...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "Given a binary string $ s \\in \\{0,1\\}^* $ with $ 1 \\leq |s| \\leq 100 $, determine whether there exists a subsequence of $ s $ that forms a binary representation of a positive integer divisible by 64.\n...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments