| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 10358 | gs14004 | 지구 온난화 (NOI13_gw) | C++98 | 444 ms | 17404 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;
typedef pair<int,int> pi;
int v[1000005],n;
priority_queue<pi,vector<pi>,greater<pi> > pq;
int main(){
scanf("%d",&n);
for (int i=1; i<=n; i++) {
int t;
scanf("%d",&t);
v[i] = 1;
pq.push(pi(t,i));
}
int ct = 1, res = 1;
while (!pq.empty()) {
int x = pq.top().first;
while (!pq.empty() && pq.top().first == x) {
int pos = pq.top().second;
ct += v[pos-1] + v[pos+1] - 1;
v[pos] = 0;
pq.pop();
}
res = max(res,ct);
}
printf("%d",res);
}| # | 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... | ||||
