diff --git a/codeforces/B/1433b.cpp b/codeforces/B/1433b.cpp new file mode 100644 index 0000000..d95f61c --- /dev/null +++ b/codeforces/B/1433b.cpp @@ -0,0 +1,37 @@ +#include + +using namespace std; + +int main () { + + int n, size, book; + int first, total, zero; + + cin >> n; + + while(n--) + { + cin >> size; + + first = total = zero = 0; + + while(size--) + { + cin >> book; + + if(first == 0 && book == 1) + first = 1; + else if(first == 1 && book == 0) + zero++; + else if(first == 1 && book == 1) + { + total += zero; + zero = 0; + } + } + + cout << total << endl; + } + + return 0; +}