# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
483231 | Monarchuwu | Global Warming (CEOI18_glo) | C++17 | 353 ms | 25920 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/**
* tăng giảm 1 đoạn bất kì 1 lượng |d| <= x để lis đạt max
* - nhận xét: kmttq, giả sử tăng 1 đoạn [i,j] lên k đơn vị thì tăng cả ở prefix lẫn suffix
* + điều này vô lý vì xét case hi[1]-lo-hi[2], lo vốn đã match với hi[2], nếu tăng lo thêm thì lis chỉ có thể giảm đi
* => ta update lại hết prefix hoặc suffix, đồng thời nhận xét là ta luôn tăng hoặc giảm hết mức (tăng giảm x đơn vị)
* => chỉ xét giảm prefix đi x (tăng suffix lên x có cấu hình sau khi nén số tương tự)
**/
#include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
using namespace std;
typedef long long ll;
const int N = 2e5 + 8;
const int N2 = N << 1;
int n, x;
int t[N];
vector<int> a;
unordered_map<int, int> mp;
void build_map() {
for (int i = 1; i <= n; ++i)
a.push_back(t[i]), a.push_back(t[i] - x);
sort(a.begin(), a.end());
a.resize(unique(a.begin(), a.end()) - a.begin());
int cnt(0);
컴파일 시 표준 에러 (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... |