report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
String transformation - FlandreOJ: Flandre Online Judge

String transformation

Time limit: 1000 ms
Memory limit: 256 MB
Given a binary string $S$ consisting of characters `0`, `1`, and `?`. In one operation, you can: - Change the character `0` to `1`. - Change the character `?` to `0` or `1`. - Swap two characters. Determine the minimum number of operations required to transform the string $S$ into a binary string $T$. ### Input - The first line contains the string $S$. - The second line contains the string $T$. ### Output - Print an integer representing the minimum number of operations. It is guaranteed that the answer exists. ### Constraints - $1 \le |S| \le 300$. ### Sample test Input: ``` 0?1? 1001 ``` Output: ``` 3 ```
Introduction to Dynamic Programming (Part two)
Sake game
Coins
Coins 2
Game on array
Longest increasing subsequence 2
Convolution
Regular bracket sequence
Faulty addition
Weird bank
Delete operation
Palindromize
Color ribbon
Unique subsequences
Unique subsequences 2
Cow exhibition
Knapsack 3
Compressing array
Regular bracket sequence 2
Maximum path 3
Concating substring
Soil
Stacking boxes
String transformation
Palindromic quadruple
Finding teammates
Topic
Dynamic Programming
Rating 1800
Solution (0) Solution