QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#939430 | #4929. Longest Unfriendly Subsequence | justin271828 | Compile Error | / | / | C++20 | 414b | 2025-03-17 13:32:50 | 2025-03-17 13:32:53 |
Judging History
This is the latest submission verdict.
- [2025-03-17 13:32:53]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-03-17 13:32:50]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int qwerty = 0; qwerty < t; qwerty++) {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
int ans = 1;
for (int i = 1; i < n; i++) {
if (arr[i] != arr[i-1]) ans++;
}
cout << ans << "\n";
}
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:14:17: error: ‘arr’ was not declared in this scope 14 | if (arr[i] != arr[i-1]) ans++; | ^~~