Submission #3854672


Source Code Expand

#include<iostream>
#include<algorithm>

int a[10001];
bool mmp(int x,int y){return x>y;}
int main(){
    int n;
    std::cin>>n;
    for(register int i=1;i<=n;++i)
        std::cin>>a[i];
    int k=unique(a+1,a+1+n)-a-1;
    sort(a+1,a+1+k,mmp);
    std::cout<<a[2];
}

Submission Info

Submission Time
Task B - 心配性な富豪、ファミリーレストランに行く。
User luogu_bot3
Language C++ (GCC 5.4.1)
Score 0
Code Size 268 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:27: error: ‘unique’ was not declared in this scope
     int k=unique(a+1,a+1+n)-a-1;
                           ^
./Main.cpp:11:27: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
                 from ./Main.cpp:2:
/usr/include/c++/5/bits/stl_algo.h:1022:5: note:   ‘std::unique’
     unique(_ForwardIterator __first, _ForwardIterator __last,
     ^
./Main.cpp:12:23: error: ‘sort’ was not declared in this scope
     sort(a+1,a+1+k,mmp);
                       ^
./Main.cpp:12:23: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
                 from ./Main.cpp:2:
/usr/include/c++/5/bits/stl_algo.h:4718:5: note:   ‘std::sort’
     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
     ^