83932024-01-15 15:11:09Balki22Legmesszebbi rossz sorrendű (35 pont)cpp17Wrong answer 0/3539ms11780 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	vector<int> nums(n);
	for (int i = 0; i < n; i++) {
		cin >> nums[i];
	}

	pair<int, int> r = {-1, -1};
	for (int i = 0; i < n-1; i++) {
		if (nums[i] > nums[i+1]) {
			r.first = i;
			break;
		}
	}
	for (int i = n-2; i >= 0; i--) {
		if (nums[i] > nums[i+1]) {
			r.second = i+1;
			break;
		}
	}
	if (r.first != r.second || r.first == -1 || r.second == -1) cout << r.first + 1 << " " << r.second + 1;

}
SubtaskSumTestVerdictTimeMemory
base0/35
1Accepted0/03ms1808 KiB
2Wrong answer0/039ms3552 KiB
3Wrong answer0/13ms2964 KiB
4Wrong answer0/13ms3056 KiB
5Wrong answer0/13ms3252 KiB
6Wrong answer0/12ms3228 KiB
7Wrong answer0/13ms3312 KiB
8Wrong answer0/13ms3408 KiB
9Wrong answer0/13ms3772 KiB
10Wrong answer0/14ms4132 KiB
11Wrong answer0/14ms4128 KiB
12Wrong answer0/217ms4460 KiB
13Wrong answer0/219ms4976 KiB
14Wrong answer0/220ms5416 KiB
15Wrong answer0/214ms5644 KiB
16Wrong answer0/220ms6068 KiB
17Wrong answer0/228ms6788 KiB
18Wrong answer0/232ms7604 KiB
19Wrong answer0/235ms8232 KiB
20Wrong answer0/237ms9276 KiB
21Wrong answer0/239ms9972 KiB
22Wrong answer0/239ms10768 KiB
23Wrong answer0/237ms11164 KiB
24Wrong answer0/237ms11780 KiB