Language: C++

#include "stdio.h"
#include <queue>

using namespace std;

int main()
{
 int n,k;
 scanf("%d %d",&n,&k);
 priority_queue q;
 for(int i = 0; i < k; i++)
 {
  int w;
  scanf("%d",&w);
  q.push(w);
 }
 int dp[2] = {0,0};
 int flg = 0;
 int max = 0;
 if(q.top() == 0)
 {
  flg = 1;
  q.pop();
 }
 for(int i = 0; i < n; i++)
 {
  if(q.empty() == true)
  {
   if(flg == 1)
   {
    if(max < dp[0] + 1)
    {
     max = dp[0] + 1;
    }
   }
   if(max < dp[0])
   {
    max = dp[0];
   }
   if(max < dp[1])
   {
    max = dp[1];
   }
   break;
  }
  if(q.top() == i)
  {
   dp[0]++;
   dp[1]++;
  }
  else
  {
   if(flg == 1)
   {
    if(max < dp[1])
    {
     max = dp[1];
    }
    dp[1] = dp[0] + 1;
   }
   if(max <　dp[0])
   {
    max = dp[0];
   }
   dp[0] = 0;
  }
 }
 printf("%d\n",max);
 return 0;
}

Compiler output:
a.cc:61:12: error: extended character 　 is not valid in an identifier
   61 |    if(max <　dp[0])
      |            ^
a.cc: In function 'int main()':
a.cc:10:17: error: class template argument deduction failed:
   10 |  priority_queue q;
      |                 ^
a.cc:10:17: error: no matching function for call to 'priority_queue()'
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_queue.h:691:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Compare&, _Sequence&&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  691 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:691:9: note:   candidate expects 5 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:679:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Sequence&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  679 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:679:9: note:   candidate expects 5 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:671:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  671 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:671:9: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:663:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class _Alloc, class, class _Requires> priority_queue(_InputIterator, _InputIterator, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  663 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:663:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:649:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class> priority_queue(_InputIterator, _InputIterator, const _Compare&, _Sequence&&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  649 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:649:9: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:638:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class> priority_queue(_InputIterator, _InputIterator, const _Compare&, const _Sequence&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  638 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:638:9: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:629:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _InputIterator, class> priority_queue(_InputIterator, _InputIterator, const _Compare&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  629 |         priority_queue(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:629:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:594:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(std::priority_queue<_Tp, _Sequence, _Compare>&&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  594 |         priority_queue(priority_queue&& __q, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:594:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:590:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const std::priority_queue<_Tp, _Sequence, _Compare>&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  590 |         priority_queue(const priority_queue& __q, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:590:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:585:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Compare&, _Sequence&&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  585 |         priority_queue(const _Compare& __x, _Sequence&& __c, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:585:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:579:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Compare&, const _Sequence&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  579 |         priority_queue(const _Compare& __x, const _Sequence& __c,
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:579:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:573:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Compare&, const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  573 |         priority_queue(const _Compare& __x, const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:573:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:569:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Alloc, class _Requires> priority_queue(const _Alloc&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  569 |         priority_queue(const _Alloc& __a)
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:569:9: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:563:7: note: candidate: 'template<class _Tp, class _Sequence, class _Compare> priority_queue(const _Compare&, _Sequence&&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  563 |       priority_queue(const _Compare& __x, _Sequence&& __s = _Sequence())
      |       ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:563:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:558:7: note: candidate: 'template<class _Tp, class _Sequence, class _Compare> priority_queue(const _Compare&, const _Sequence&)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  558 |       priority_queue(const _Compare& __x, const _Sequence& __s)
      |       ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:558:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:554:9: note: candidate: 'template<class _Tp, class _Sequence, class _Compare, class _Seq, class _Requires> priority_queue()-> std::priority_queue<_Tp, _Sequence, _Compare>'
  554 |         priority_queue()
      |         ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:554:9: note:   template argument deduction/substitution failed:
a.cc:10:17: note:   couldn't deduce template parameter '_Tp'
   10 |  priority_queue q;
      |                 ^
/usr/include/c++/14/bits/stl_queue.h:496:11: note: candidate: 'template<class _Tp, class _Sequence, class _Compare> priority_queue(std::priority_queue<_Tp, _Sequence, _Compare>)-> std::priority_queue<_Tp, _Sequence, _Compare>'
  496 |     class priority_queue
      |           ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:496:11: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_queue.h:818:5: note: candidate: 'template<class _Compare, class _Container, class _Allocator, class, class> std::priority_queue(_Compare, _Container, _Allocator)-> priority_queue<typename _Container::value_type, _Container, _Compare>'
  818 |     priority_queue(_Compare, _Container, _Allocator)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:818:5: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:811:5: note: candidate: 'template<class _InputIterator, class _ValT, class _Compare, class _Container, class, class, class> std::priority_queue(_InputIterator, _InputIterator, _Compare, _Container)-> priority_queue<_ValT, _Container, _Compare>'
  811 |     priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(),
      |     ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:811:5: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_queue.h:801:5: note: candidate: 'template<class _Compare, class _Container, class, class> std::priority_queue(_Compare, _Container)-> priority_queue<typename _Container::value_type, _Container, _Compare>'
  801 |     priority_queue(_Compare, _Container)
      |     ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:801:5: note:   candidate expects 2 arguments, 0 provided
a.cc:61:12: error: '\U00003000dp' was not declared in this scope
   61 |    if(max <　dp[0])
      |            ^~~~