0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-30 16:36:26 +00:00

B - NIT Destroys the Universe

https://codeforces.com/contest/1696/submission/161746915
This commit is contained in:
Baoshuo Ren 2022-06-25 22:51:16 +08:00
parent 23e95a90df
commit 4f89724f85
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

32
Codeforces/1696/B/B.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 1e5 + 5;
int t, n, a[N];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> t;
while (t--) {
int cnt = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
if (!a[i - 1] && a[i]) cnt++;
}
cout << std::min(2, cnt) << endl;
}
return 0;
}