| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 837083 | aZvezda | Sequence (APIO23_sequence) | C++17 | 2054 ms | 52492 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "sequence.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 1e6 + 10;
vector<int> where[MAX_N];
int small[MAX_N], big[MAX_N];
int arr[MAX_N];
int sequence(int n, std::vector<int> A) {
	for(int i = 0; i < n; i ++) {
		arr[i + 1] = A[i];
	}
	for(int i = 1; i <= n; i ++) {
		where[arr[i]].push_back(i);
	}
	int ans = 0;
	for(int val = 0; val <= n; val ++) {
		if(where[val].empty()) { continue; }
		for(int i = 1; i <= n; i ++) {
			small[i] = (arr[i] < val) + small[i - 1];
			big[i] = (arr[i] > val) + big[i - 1];
		}
		for(int i = 0; i < where[val].size(); i ++) {
			int l = where[val][i];
			for(int j = i + 1; j < where[val].size(); j ++) {
				int r = where[val][j];
				if(2 * (small[r] - small[l - 1]) <= (r - l + 1) && 2 * (big[r] - big[l - 1]) <= (r - l + 1)) {
					ans = max(ans, j - i + 1);
				}
			}
		}
	}
	
	return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
