QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#567142 | #9313. Make Max | CuberW | WA | 0ms | 3624kb | C++14 | 597b | 2024-09-16 08:43:19 | 2024-09-16 08:43:19 |
Judging History
answer
#include <iostream>
#include <vector>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
// Count transitions
int operations = 0;
for (int i = 1; i < n; ++i) {
if (a[i] != a[i - 1]) {
operations += 1;
}
}
// Output the maximum number of operations
cout << operations << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3624kb
input:
4 2 1 2 2 2 2 7 1 1 1 2 2 2 2 3 1 2 3
output:
1 0 1 2
result:
wrong answer 3rd numbers differ - expected: '3', found: '1'