QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#699409 | #9229. Juliet Unifies Ones | anyan26 | WA | 1ms | 3856kb | C++17 | 586b | 2024-11-02 08:49:36 | 2024-11-02 08:49:36 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main(){
string s; cin >> s;
int ret = s.size();
for(int i = 0; i < s.size(); i++){
for(int j = i; j < s.size(); j++){
int cur = 0;
for(int a = 0; a < i; a++){
if(s[a]=='1')cur++;
}
for(int a = i; a < j; a++){
if(s[a]=='0')cur++;
}
for(int a = j; a < s.size(); a++){
if(s[a]=='1')cur++;
}
ret = min(ret, cur);
}
}
cout << ret << "\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3628kb
input:
00011011001
output:
2
result:
ok 1 number(s): "2"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
11101111111111111101001011110111111110011101010110
output:
11
result:
ok 1 number(s): "11"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
00000000100000000000100000010001000
output:
3
result:
ok 1 number(s): "3"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
00000000000000000000000000000000000000000000000000
output:
0
result:
ok 1 number(s): "0"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
00000000100000000000100000011000
output:
2
result:
ok 1 number(s): "2"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
11000010100100000011101100000001000100000000000000
output:
8
result:
ok 1 number(s): "8"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
01100100111011110101010110000100001111110001110001
output:
19
result:
ok 1 number(s): "19"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
1110101111001
output:
3
result:
ok 1 number(s): "3"
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3628kb
input:
1
output:
1
result:
wrong answer 1st numbers differ - expected: '0', found: '1'