QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#273413 | #7880. Streak Manipulation | ucup-team088# | AC ✓ | 120ms | 45556kb | C++17 | 8.0kb | 2023-12-02 23:43:21 | 2023-12-02 23:43:21 |
Judging History
answer
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<cassert>
#include<complex>
#include<numeric>
#include<array>
#include<chrono>
using namespace std;
//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
//ll mod = 1;
constexpr ll mod = 998244353;
//constexpr ll mod = 1000000007;
const int mod17 = 1000000007;
const ll INF = (ll)mod17 * mod17;
typedef pair<int, int>P;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
using ld = double;
typedef pair<ld, ld> LDP;
const ld eps = 1e-10;
const ld pi = acosl(-1.0);
template<typename T>
void chmin(T& a, T b) {
a = min(a, b);
}
template<typename T>
void chmax(T& a, T b) {
a = max(a, b);
}
template<typename T>
vector<T> vmerge(vector<T>& a, vector<T>& b) {
vector<T> res;
int ida = 0, idb = 0;
while (ida < a.size() || idb < b.size()) {
if (idb == b.size()) {
res.push_back(a[ida]); ida++;
}
else if (ida == a.size()) {
res.push_back(b[idb]); idb++;
}
else {
if (a[ida] < b[idb]) {
res.push_back(a[ida]); ida++;
}
else {
res.push_back(b[idb]); idb++;
}
}
}
return res;
}
template<typename T>
void cinarray(vector<T>& v) {
rep(i, v.size())cin >> v[i];
}
template<typename T>
void coutarray(vector<T>& v) {
rep(i, v.size()) {
if (i > 0)cout << " "; cout << v[i];
}
cout << "\n";
}
ll mod_pow(ll x, ll n, ll m = mod) {
if (n < 0) {
ll res = mod_pow(x, -n, m);
return mod_pow(res, m - 2, m);
}
if (abs(x) >= m)x %= m;
if (x < 0)x += m;
//if (x == 0)return 0;
ll res = 1;
while (n) {
if (n & 1)res = res * x % m;
x = x * x % m; n >>= 1;
}
return res;
}
//mod should be <2^31
struct modint {
int n;
modint() :n(0) { ; }
modint(ll m) {
if (m < 0 || mod <= m) {
m %= mod; if (m < 0)m += mod;
}
n = m;
}
operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
bool operator<(modint a, modint b) { return a.n < b.n; }
modint operator+=(modint& a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= (int)mod; return a; }
modint operator-=(modint& a, modint b) { a.n -= b.n; if (a.n < 0)a.n += (int)mod; return a; }
modint operator*=(modint& a, modint b) { a.n = ((ll)a.n * b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, ll n) {
if (n == 0)return modint(1);
modint res = (a * a) ^ (n / 2);
if (n % 2)res = res * a;
return res;
}
ll inv(ll a, ll p) {
return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
modint operator/=(modint& a, modint b) { a = a / b; return a; }
const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init_f() {
fact[0] = modint(1);
for (int i = 0; i < max_n - 1; i++) {
fact[i + 1] = fact[i] * modint(i + 1);
}
factinv[max_n - 1] = modint(1) / fact[max_n - 1];
for (int i = max_n - 2; i >= 0; i--) {
factinv[i] = factinv[i + 1] * modint(i + 1);
}
}
modint comb(int a, int b) {
if (a < 0 || b < 0 || a < b)return 0;
return fact[a] * factinv[b] * factinv[a - b];
}
modint combP(int a, int b) {
if (a < 0 || b < 0 || a < b)return 0;
return fact[a] * factinv[a - b];
}
ll gcd(ll a, ll b) {
a = abs(a); b = abs(b);
if (a < b)swap(a, b);
while (b) {
ll r = a % b; a = b; b = r;
}
return a;
}
template<typename T>
void addv(vector<T>& v, int loc, T val) {
if (loc >= v.size())v.resize(loc + 1, 0);
v[loc] += val;
}
/*const int mn = 2000005;
bool isp[mn];
vector<int> ps;
void init() {
fill(isp + 2, isp + mn, true);
for (int i = 2; i < mn; i++) {
if (!isp[i])continue;
ps.push_back(i);
for (int j = 2 * i; j < mn; j += i) {
isp[j] = false;
}
}
}*/
//[,val)
template<typename T>
auto prev_itr(set<T>& st, T val) {
auto res = st.lower_bound(val);
if (res == st.begin())return st.end();
res--; return res;
}
//[val,)
template<typename T>
auto next_itr(set<T>& st, T val) {
auto res = st.lower_bound(val);
return res;
}
using mP = pair<modint, modint>;
mP operator+(mP a, mP b) {
return { a.first + b.first,a.second + b.second };
}
mP operator+=(mP& a, mP b) {
a = a + b; return a;
}
mP operator-(mP a, mP b) {
return { a.first - b.first,a.second - b.second };
}
mP operator-=(mP& a, mP b) {
a = a - b; return a;
}
LP operator+(LP a, LP b) {
return { a.first + b.first,a.second + b.second };
}
LP operator+=(LP& a, LP b) {
a = a + b; return a;
}
LP operator-(LP a, LP b) {
return { a.first - b.first,a.second - b.second };
}
LP operator-=(LP& a, LP b) {
a = a - b; return a;
}
mt19937 mt(time(0));
const string drul = "DRUL";
string senw = "SENW";
//DRUL,or SENW
//int dx[4] = { 1,0,-1,0 };
//int dy[4] = { 0,1,0,-1 };
//------------------------------------
void solve() {
int n, m, k; cin >> n >> m >> k;
string s; cin >> s;
vector<int> c0(n + 1);
rep(i, s.size()) {
c0[i + 1] = c0[i];
if (s[i] == '0')c0[i + 1]++;
}
int num = 0;
vector<vector<int>> dp(n+1, vector<int>(k + 1));
vector<vector<int>> rdp(n + 1, vector<int>(k + 1));
vector<vector<int>> mem(n + 1, vector<int>(k + 1));
auto can = [&](int len) {
rep(i, n + 1)rep(j, k + 1)dp[i][j] = mod17;
int mi = mod17;
rep(i, n+1) {
if (i >= len) {
chmin(mi, c0[i] - c0[i - len]);
}
if (i == n || s[i] == '0') {
chmin(dp[i][0], 0);
chmin(dp[i][1], mi);
}
}
rep(i, n + 1) {
int pre = i - len - 1;
if (pre >= 0) {
int val = c0[pre + 1 + len] - c0[pre + 1];
rep(j, k + 1) {
mem[pre][j] = rdp[pre][j] + val;
}
if (pre > 0) {
rep(j, k + 1) {
chmin(mem[pre][j], mem[pre - 1][j]);
}
}
}
if (i == n || s[i] == '0') {
if (pre >= 0) {
rep(j, k) {
chmin(dp[i][j+1], mem[pre][j]);
}
}
}
rep(j, k + 1) {
rdp[i][j] = dp[i][j];
if (i > 0)chmin(rdp[i][j], rdp[i - 1][j]);
}
}
//cout << len << " " << rdp[n][k] << "\n";
return rdp[n][k] <= m;
};
int le = 0, ri = n + 1;
while (ri - le > 1) {
int mid = (le + ri) / 2;
if (can(mid))le = mid;
else ri = mid;
}
if (le == 0)le--;
cout << le << "\n";
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
//cout << fixed<<setprecision(10);
//init_f();
//init();
//while(true)
//expr();
//int t; cin >> t; rep(i, t)
solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 5ms
memory: 11880kb
input:
8 3 2 10110110
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 2ms
memory: 11892kb
input:
12 3 3 100100010011
output:
2
result:
ok 1 number(s): "2"
Test #3:
score: 0
Accepted
time: 4ms
memory: 11824kb
input:
4 4 4 0000
output:
-1
result:
ok 1 number(s): "-1"
Test #4:
score: 0
Accepted
time: 4ms
memory: 12124kb
input:
1000 200 5 0001001000101001110010011001101010110101101100010100111110111111010010001100100111100101011100011101011001110010111100100100011001010011000100011111010110100001101110101001110000001000111010000111110100111101100110011010011111000111101001010011000111010111010100101111100000100001011001010...
output:
99
result:
ok 1 number(s): "99"
Test #5:
score: 0
Accepted
time: 2ms
memory: 12044kb
input:
1000 200 5 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
40
result:
ok 1 number(s): "40"
Test #6:
score: 0
Accepted
time: 4ms
memory: 11992kb
input:
1000 200 5 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
-1
result:
ok 1 number(s): "-1"
Test #7:
score: 0
Accepted
time: 82ms
memory: 45324kb
input:
200000 5 3 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
2
result:
ok 1 number(s): "2"
Test #8:
score: 0
Accepted
time: 81ms
memory: 45336kb
input:
200000 5 2 0001010000000000000000010011000001000000000000000001100000000001000000000000010011000010000000000110000010000010000100000000001001010000011000100000000001001000000000011110000100000011000000100110100110001011000000000000000000000000110001000000100000011100010011010001010010010100000000000...
output:
13
result:
ok 1 number(s): "13"
Test #9:
score: 0
Accepted
time: 109ms
memory: 45248kb
input:
200000 5 5 0001100001100000001011100010111101100100110001000011001011111101110100000000000111101001110100010101010100110100100011001100000010110111110010111011110100100101011001100101001010110100011101011001000101011110110010001011111101011101011010101101010001111110101001001110000000000010101001001...
output:
17
result:
ok 1 number(s): "17"
Test #10:
score: 0
Accepted
time: 97ms
memory: 45348kb
input:
200000 5 5 1011101011100110010111011011101110111111101111110111101111011110110111111101111011110101101110001100111110010101111011111101111111111111110110111111111011111111111111111111111111011100101111001110011100111100001111111111110101111011110010111001101111111111110110010101100111111111111111011...
output:
45
result:
ok 1 number(s): "45"
Test #11:
score: 0
Accepted
time: 72ms
memory: 45408kb
input:
200000 5 4 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
24879
result:
ok 1 number(s): "24879"
Test #12:
score: 0
Accepted
time: 99ms
memory: 45336kb
input:
200000 5 5 1010101010010101001010100101011010110010100101000010100101010101001010110101010101010101101010110101010101010101011001010101010101010101011001010101010100010101010010101000101001010101010110010101010110101101010111101010110101010101010010101010110111010010110111011010101010101110111001101...
output:
9
result:
ok 1 number(s): "9"
Test #13:
score: 0
Accepted
time: 66ms
memory: 45464kb
input:
200000 5 1 1001001011010101010101010101110101010100101001001010101101110101011010110101010110101010101011010101010101010010101010101000100110111110101101010101101011010101010101011010101010101010101010010101010101010110101001010101010101010110101010101010101011011010001010101011010101010101010101001...
output:
20
result:
ok 1 number(s): "20"
Test #14:
score: 0
Accepted
time: 103ms
memory: 45312kb
input:
200000 5 5 0001000000001111111100001000000000111100000111111100000000000011111000011110000000111001111100110000000000000000110000000000000000000011111111100000000111001111111111100000000011100000000010000111100111110000000111111110001111110111001100111111111001011111110111000111111111111111111111111...
output:
50
result:
ok 1 number(s): "50"
Test #15:
score: 0
Accepted
time: 81ms
memory: 45556kb
input:
200000 5 4 0111111111111111111101100000111111100101011111110000000111111110010011111111111101111111110000001001111111111111111110001111111111111111111111111111111111111111111101110110000000000111111111111001101111111111010000111111110000011000111100001111111110101111111101100000011101000111111111111...
output:
90
result:
ok 1 number(s): "90"
Test #16:
score: 0
Accepted
time: 84ms
memory: 45420kb
input:
200000 5 4 0000100000110000000111100000000000111111100011111110001001110000000000001000000001100000011110000000010000000000011110000111111111101110000000100000000111100000011000011111001001000000000011000100000000000000001110000001000010000000000011111000000000000000000100000000011000000000000000000...
output:
22
result:
ok 1 number(s): "22"
Test #17:
score: 0
Accepted
time: 72ms
memory: 45128kb
input:
200000 170 3 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
57
result:
ok 1 number(s): "57"
Test #18:
score: 0
Accepted
time: 71ms
memory: 45292kb
input:
200000 170 2 00000000000000011000001010110010100000001010100001010010100011010110101100010100100010000001010000010000001000001010111100000101000110010000000010100000000100100010000000000110001000000001000101000010100000000000010100101100100011000100100000000010000101001010000000010000110000000000000...
output:
143
result:
ok 1 number(s): "143"
Test #19:
score: 0
Accepted
time: 117ms
memory: 45336kb
input:
200000 170 5 00000000110010110001010110100010110110100111110011111010101001111011101011111011101010100000001100110100000011000110001100000111011111001011001101011111111011101010100111001100011010100100001100010000001010010101011100001010111100011100101110111001110101011011100011100010010011001000100...
output:
107
result:
ok 1 number(s): "107"
Test #20:
score: 0
Accepted
time: 95ms
memory: 45340kb
input:
200000 170 5 10110010111110111011101101110111110111111011111110011111010111111111010100111001010111111111111001111011011011111111101011111011111111111010111111100111001001111100010111111001111011111011101100101110010101111101101011111101110011111110010001111101101101011110110111011111101010010111111...
output:
225
result:
ok 1 number(s): "225"
Test #21:
score: 0
Accepted
time: 75ms
memory: 45252kb
input:
200000 170 4 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
44639
result:
ok 1 number(s): "44639"
Test #22:
score: 0
Accepted
time: 101ms
memory: 45348kb
input:
200000 170 5 10101011010101100101010101000101010110010101010010101001010101101001010110101001010010101010101010101011010101010010100101101110101010101001010101101100101010101101011010101010101010100110101110110101101100100101010101000110101010101001010101111010101010101000100101010101010101010101010...
output:
85
result:
ok 1 number(s): "85"
Test #23:
score: 0
Accepted
time: 63ms
memory: 45340kb
input:
200000 170 1 00101101010101011010101101010100100100110111110010100100110110101010100110101010011010101011101001101010101011101010010101010100101100101010110101001010101101101010101010001010010110100010110101010110101110101001010010010101101010100010101011001010101000010101110010110101010101101101010...
output:
371
result:
ok 1 number(s): "371"
Test #24:
score: 0
Accepted
time: 92ms
memory: 45296kb
input:
200000 170 5 00111111100111111100000000011100111000000001110000000000101111111110000111111000000001111111111111111100010000111000000001111101111110001111000001111100000000111111100011111111111111111111110110000000000111111111111111100000001111111111111110000111111011111000001111111111100001111111100...
output:
174
result:
ok 1 number(s): "174"
Test #25:
score: 0
Accepted
time: 97ms
memory: 45340kb
input:
200000 170 4 00100101111111111110000111111000001111111111111111111111001000011111111001110011111111111100001111111111111110111111111111111111111111011110001111100111111111111111111111111111011101111111111110011111111111111000011101111101101111100001111111111111111011110001111111111111001111111000001...
output:
342
result:
ok 1 number(s): "342"
Test #26:
score: 0
Accepted
time: 99ms
memory: 45352kb
input:
200000 170 4 00000111111111000000010000000000111000100110000000110000000000011000000111100000000110000000000000011100000000000111111100000010010000001000000000000000000000000000000000000000000011000110000000000000010000000000000000000000000000000000011100000000110000000000010000000000000000111111000...
output:
98
result:
ok 1 number(s): "98"
Test #27:
score: 0
Accepted
time: 69ms
memory: 45344kb
input:
200000 5780 3 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
1928
result:
ok 1 number(s): "1928"
Test #28:
score: 0
Accepted
time: 79ms
memory: 45200kb
input:
200000 5780 2 0000001000000000011010000000000000100110101010000011011010000000000100011001001001001010100010100001100100000000010010010000000000000001010001001000000011000001000110000000000001001000110110010100001001110010000000010010000100011000001010110000001001000001010001000000100011000000100000...
output:
3962
result:
ok 1 number(s): "3962"
Test #29:
score: 0
Accepted
time: 120ms
memory: 45404kb
input:
200000 5780 5 1110111001110010111101101000110001011010111111011011110101000101010001101110111111001100001011110010110000011011110100110100011001010110010011000011110101011101000111001111001000001001101001111001110000011001010001110101011000010101000011001011000010110010001001010111010111001001011101...
output:
2436
result:
ok 1 number(s): "2436"
Test #30:
score: 0
Accepted
time: 105ms
memory: 45460kb
input:
200000 5780 5 1101110011001101101110011100111101101111001011111101010101111100111010111111101111111101011110100111001111111110110111101100111111111111111111111011011111110101111111001111111110110111011111111111110001110101111110011111111100110010101111110111010111110110110110011101111110111101111111...
output:
4936
result:
ok 1 number(s): "4936"
Test #31:
score: 0
Accepted
time: 60ms
memory: 45260kb
input:
200000 5780 4 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
36897
result:
ok 1 number(s): "36897"
Test #32:
score: 0
Accepted
time: 95ms
memory: 45320kb
input:
200000 5780 5 1101011101010101010101010101010101011010101010101101010110101010110101010101101101010100111001010101010101000101010010100010100101010101010100101101010101011011001001101011011010101011001001001010110110101010101010100010110110100011010010101101010010101010101011010101010101010101011010...
output:
2372
result:
ok 1 number(s): "2372"
Test #33:
score: 0
Accepted
time: 67ms
memory: 45388kb
input:
200000 5780 1 1010101101010100111010101011110010110101010111010101010101010101101000101011001010110101011010101111101101000010100100101101010101001001010110010101001010011010101010101110101000110101010101010101011010100110101010100101010101101001011011010100100110100100101010101001010101010110101101...
output:
11661
result:
ok 1 number(s): "11661"
Test #34:
score: 0
Accepted
time: 91ms
memory: 45556kb
input:
200000 5780 5 0000111110001111111111111111111000000111111111100000000011111111111100011100011100000000000000000111000001111110000000111111110000000011100001111111111111100000000000000011100000001100011111011110100011111001111111110000000001111110011111111111111111001110000000000000000001000000000000...
output:
2622
result:
ok 1 number(s): "2622"
Test #35:
score: 0
Accepted
time: 78ms
memory: 45344kb
input:
200000 5780 4 1111111000100111111111111101001101111111111110111111100001101111100010101111110001111111111110011111111111111111110011111111100011110001111101111111111111111111111111111111111110011111111110000001100011111111111111111111111111111111101111111111111000001111111111111111110011011111110000...
output:
6266
result:
ok 1 number(s): "6266"
Test #36:
score: 0
Accepted
time: 93ms
memory: 45324kb
input:
200000 5780 4 0000000000010000101111110001000001111111000000001100000000101111111111011101111110011111000000000011110000000000000000001000110000000000000000000000000000111001111100000000000000100000010000000000001100000000001111111100000000000111100100000111000001100000000000010000000010000011110000...
output:
2083
result:
ok 1 number(s): "2083"
Test #37:
score: 0
Accepted
time: 67ms
memory: 45460kb
input:
200000 196520 3 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
65514
result:
ok 1 number(s): "65514"
Test #38:
score: 0
Accepted
time: 72ms
memory: 45208kb
input:
200000 196520 2 00101100000000000100000000110000000000000010110010000000100000001001001000000000000000010100101000000101000000100000000000001010100011000100000100000000000001001000000000011100010010001000001000100100000000000101000100001100000000000000110000000000000000010000000000100000000001101000...
output:
99999
result:
ok 1 number(s): "99999"
Test #39:
score: 0
Accepted
time: 113ms
memory: 45460kb
input:
200000 196520 5 01101011111001100101110100100001001101001111101101001000101011111100011000001100001001001101111001100000110100010001100110001001111010011110101010010000111101001000101110001111010010001110100101110100011001111110000111001011001101011000101010100101011001000111100001001101100010100101...
output:
39998
result:
ok 1 number(s): "39998"
Test #40:
score: 0
Accepted
time: 82ms
memory: 45476kb
input:
200000 196520 5 11111011110001111110111110110110011011111010011111010111001111101000101011111111101111110110111111111111111111001010111111000111111111110111101011111001101111110110001111101011101101110011110010111010110011110111111011011000010100111011101101110111111001000000110111111100011011001100...
output:
39998
result:
ok 1 number(s): "39998"
Test #41:
score: 0
Accepted
time: 69ms
memory: 45328kb
input:
200000 196520 4 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111...
output:
41481
result:
ok 1 number(s): "41481"
Test #42:
score: 0
Accepted
time: 90ms
memory: 45424kb
input:
200000 196520 5 10101101101010110101011101010100101010101010100101010100110101010010101000101010101010101010110101010101001101010110101101010101010110101100010101010101010101010101010101011010010101010100100101010101001010101010100100111001101010101101010100101011101010101010101010101010101010101010...
output:
39998
result:
ok 1 number(s): "39998"
Test #43:
score: 0
Accepted
time: 56ms
memory: 45264kb
input:
200000 196520 1 01010010101010001101010101010101010101001010100110110101010101010010110100101010101101010101010101010011011101010100110101101011101010101101010110101001010101011101011010100101001010101011010101001101010110101011011010101010100101010101001010110101010101101010101010100101010101001010...
output:
200000
result:
ok 1 number(s): "200000"
Test #44:
score: 0
Accepted
time: 84ms
memory: 45308kb
input:
200000 196520 5 00001111101000111111011110011111100111000000000000000000111111000000000000011110000000000000000011111110000011100011000000000111001111111000000001001111010100001111111111111101111100000000000001100000000000111000011111111110001111111110000000000011100000000000100011111111110000001110...
output:
39995
result:
ok 1 number(s): "39995"
Test #45:
score: 0
Accepted
time: 85ms
memory: 45464kb
input:
200000 196520 4 01110000001001111111000000011001000000011111111111001100000001000000110000111111111111110011111111111000000000001111111111011111111111111111110011111111000001000011111111111111111011111100111101111111111111111111111111001111001011100111100111111111111110111001111100011111100001111111...
output:
49993
result:
ok 1 number(s): "49993"
Test #46:
score: 0
Accepted
time: 81ms
memory: 45252kb
input:
200000 196520 4 01000000001100000001100000000000000000011000001011110000000000001000000110000000000000000000000000000000000000000010000111111110000000011100000000000011000000000000001101100000000000000000000000000000000111110000000000000000000011111000000000110100000000111110000001111111111111000000...
output:
49998
result:
ok 1 number(s): "49998"
Extra Test:
score: 0
Extra Test Passed