QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#553497 | #9229. Juliet Unifies Ones | AITU 0 (Altair Ashurov, Almaz Shinbay, Zhambyl Maksotov)# | WA | 0ms | 3856kb | C++20 | 634b | 2024-09-08 14:14:32 | 2024-09-08 14:14:33 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define sz(x) (int)x.size()
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
string s;
cin >> s;
int n = sz(s);
int ans = 1e9;
for (int i = 0; i < n; ++i) {
for (int j = i; j < n; ++j) {
int cnt = 0;
for (int k = 0; k < n; ++k) {
if (k < i || k > j)
cnt += (s[k] == '1');
else
cnt += (s[k] == '0');
}
ans = min(ans, cnt);
}
}
cout << ans << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
00011011001
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
11101111111111111101001011110111111110011101010110
output:
11
result:
ok 1 number(s): "11"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
00000000100000000000100000010001000
output:
3
result:
ok 1 number(s): "3"
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3620kb
input:
00000000000000000000000000000000000000000000000000
output:
1
result:
wrong answer 1st numbers differ - expected: '0', found: '1'