# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1010639 | lrancic | Crazy old lady (IZhO13_crazy) | C++17 | 0 ms | 344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
bool check_arr(int n, std::vector<int> &line, int crazy) {
bool inf = false;
for (int i = n-1; i >= 0; i--) {
if (line[i] == crazy) break;
if (line[i] == i+1) continue;
inf = true; break;
}
return !inf;
}
int solve(int n, std::vector<int> &line) {
int i = 0; for (; i < n; i++) if (line[i] == 1) break;
return (n-i == 2);
}
int main() {
std::ios_base::sync_with_stdio(false), std::cin.tie(nullptr), std::cout.tie(nullptr);
int _; std::cin >> _; while (_--) {
int n; std::cin >> n; std::vector<int> line(n); for (int i = 0; i < n; i++) std::cin >> line[i];
std::cout << solve(n, line) << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |