Submission #3003475


Source Code Expand

#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << x << endl;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
int used[123456];
int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    priority_queue<pii>pq;
    int ans = 0;
    rep(i,n){
        cin >> a[i];
        pq.push(pii(a[i],i));
    }
    while(!pq.empty()){
        auto x = pq.top();
        pq.pop();
        if(used[x.second]>=1)continue;
        int id = x.second;
        used[id]++;
        int temp = 1;
        while(id+1 < n and a[id] > a[id+1]){
            used[id+1]++;
            temp++;
            id++;
        }
        id = x.second;
        while(id-1 >= 0 and a[id-1] < a[id]){
            used[id-1]++;
            temp++;
            id--;
        }
        ans = max(temp,ans);
    }
    cout << ans << endl;
}

Submission Info

Submission Time
Task B - 山のデータ
User polyomino
Language C++14 (Clang 3.8.0)
Score 30
Code Size 1330 Byte
Status RE
Exec Time 428 ms
Memory 7152 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 30 / 30 0 / 70
Status
AC × 2
AC × 17
AC × 19
RE × 13
Set Name Test Cases
Sample subtask0-sample-01.txt, subtask0-sample-02.txt
Subtask1 subtask0-sample-01.txt, subtask0-sample-02.txt, subtask1-01.txt, subtask1-02.txt, subtask1-03.txt, subtask1-04.txt, subtask1-05.txt, subtask1-06.txt, subtask1-07.txt, subtask1-08.txt, subtask1-09.txt, subtask1-10.txt, subtask1-11.txt, subtask1-12.txt, subtask1-13.txt, subtask1-14.txt, subtask1-15.txt
Subtask2 subtask0-sample-01.txt, subtask0-sample-02.txt, subtask1-01.txt, subtask1-02.txt, subtask1-03.txt, subtask1-04.txt, subtask1-05.txt, subtask1-06.txt, subtask1-07.txt, subtask1-08.txt, subtask1-09.txt, subtask1-10.txt, subtask1-11.txt, subtask1-12.txt, subtask1-13.txt, subtask1-14.txt, subtask1-15.txt, subtask2-01.txt, subtask2-02.txt, subtask2-03.txt, subtask2-04.txt, subtask2-05.txt, subtask2-06.txt, subtask2-07.txt, subtask2-08.txt, subtask2-09.txt, subtask2-10.txt, subtask2-11.txt, subtask2-12.txt, subtask2-13.txt, subtask2-14.txt, subtask2-15.txt
Case Name Status Exec Time Memory
subtask0-sample-01.txt AC 1 ms 256 KB
subtask0-sample-02.txt AC 1 ms 256 KB
subtask1-01.txt AC 1 ms 256 KB
subtask1-02.txt AC 1 ms 256 KB
subtask1-03.txt AC 1 ms 256 KB
subtask1-04.txt AC 1 ms 256 KB
subtask1-05.txt AC 1 ms 256 KB
subtask1-06.txt AC 1 ms 256 KB
subtask1-07.txt AC 1 ms 256 KB
subtask1-08.txt AC 1 ms 256 KB
subtask1-09.txt AC 1 ms 256 KB
subtask1-10.txt AC 1 ms 256 KB
subtask1-11.txt AC 1 ms 256 KB
subtask1-12.txt AC 1 ms 256 KB
subtask1-13.txt AC 1 ms 256 KB
subtask1-14.txt AC 1 ms 256 KB
subtask1-15.txt AC 1 ms 256 KB
subtask2-01.txt AC 19 ms 640 KB
subtask2-02.txt AC 100 ms 1784 KB
subtask2-03.txt RE 261 ms 3060 KB
subtask2-04.txt RE 420 ms 6000 KB
subtask2-05.txt RE 420 ms 6000 KB
subtask2-06.txt RE 418 ms 5872 KB
subtask2-07.txt RE 427 ms 6384 KB
subtask2-08.txt RE 424 ms 6000 KB
subtask2-09.txt RE 421 ms 6896 KB
subtask2-10.txt RE 421 ms 6000 KB
subtask2-11.txt RE 428 ms 7152 KB
subtask2-12.txt RE 418 ms 6640 KB
subtask2-13.txt RE 428 ms 6896 KB
subtask2-14.txt RE 423 ms 6128 KB
subtask2-15.txt RE 428 ms 6896 KB