7522022-01-08 00:37:45fp3t3rInverziócpp11Time limit exceeded 9/50595ms48852 KiB
#include <cstdio>
#include <vector>
#include <cmath>

using namespace std;

int main() {
  int n; scanf("%d", &n);
  vector<int> nums(n);
  for (int i = 0; i < n; i++)
    scanf("%d", &nums[i]);
  int mx = 0, maxi = 0, maxj = 0;
  for (int i = 0; i < n-1; i++) {
    for (int j = i+1; j < n; j++) {
      if (nums[i] > nums[j] && mx < j-i) {
         mx = j-i;
         maxi = i+1;
         maxj = j+1;
      }
    }
  }
  printf("%d %d\n", maxi, maxj);
}
SubtaskSumTestVerdictTimeMemory
base9/50
1Accepted0/02ms1164 KiB
2Time limit exceeded0/0529ms1552 KiB
3Wrong answer0/11ms1516 KiB
4Accepted2/23ms1568 KiB
5Accepted7/72ms1572 KiB
6Time limit exceeded0/2577ms1676 KiB
7Time limit exceeded0/2547ms6664 KiB
8Time limit exceeded0/2592ms10144 KiB
9Time limit exceeded0/2558ms13360 KiB
10Time limit exceeded0/2518ms16720 KiB
11Time limit exceeded0/2544ms20012 KiB
12Time limit exceeded0/2527ms17460 KiB
13Time limit exceeded0/2504ms20812 KiB
14Time limit exceeded0/2541ms24120 KiB
15Time limit exceeded0/2509ms27388 KiB
16Time limit exceeded0/2587ms30704 KiB
17Time limit exceeded0/2595ms34064 KiB
18Time limit exceeded0/2574ms37452 KiB
19Time limit exceeded0/3517ms39620 KiB
20Time limit exceeded0/3552ms35572 KiB
21Time limit exceeded0/2554ms39080 KiB
22Time limit exceeded0/2549ms42212 KiB
23Time limit exceeded0/2561ms45612 KiB
24Time limit exceeded0/2509ms48852 KiB