QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#699409#9229. Juliet Unifies Onesanyan26WA 1ms3856kbC++17586b2024-11-02 08:49:362024-11-02 08:49:36

Judging History

This is the latest submission verdict.

  • [2024-11-02 08:49:36]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3856kb
  • [2024-11-02 08:49:36]
  • Submitted

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";
}

詳細信息

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'