#include <bits/stdc++.h> using namespace std; #define ll long long //# define int long long #define ull unsigned long long #define pii pair<int,int> #define double long double #define baoliu(x, y) cout << fixed << setprecision(y) << x #define endl "\n"
const int N = 2e5 + 10; const int M = 1e6 + 10; const int inf = 0x3f3f3f3f; const int mod = 998244353; const double eps = 1e-8; int n, m; int a[N];
void solve(){ string s; cin>>s; int len=s.length(); int ans=0;
for(int i=0;i<len;i++){ int c1=0,c0=0; for(int j=i;j<len;j++){ int tmp=s[j]; if(tmp=='0'&&(j-i)%2==0||tmp=='1'&&(j-i)%2==1)c1++; else c0++; ans+=min(c1,c0); } } cout<<ans<<endl; } int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(false);
// Problem: 小美的元素删除 // Contest: NowCoder // URL: https://ac.nowcoder.com/acm/contest/64593/D // Memory Limit: 524288 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h> using namespace std; #define ll long long # define int long long #define ull unsigned long long #define pii pair<int,int> #define double long double #define baoliu(x, y) cout << fixed << setprecision(y) << x #define endl "\n"
const int N = 1e3+2; const int M = 1e6 + 10; const int inf = 0x3f3f3f3f; const int mod = 1e9+7; const double eps = 1e-8; int n, m; int a[N]; int f[N][N];