F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_38831075_8082.cpp: In static member function 'static int KMP<T>::longestSubsequence(const std::vector<int>&, int)':
0_0_38831075_8082.cpp:112:17: error: 'map' was not declared in this scope
  112 |                 map<int, int>ans;
      |                 ^~~
0_0_38831075_8082.cpp:5:1: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
    4 | #include<vector>
  +++ |+#include <map>
    5 | using namespace std;
0_0_38831075_8082.cpp:112:21: error: expected primary-expression before 'int'
  112 |                 map<int, int>ans;
      |                     ^~~
0_0_38831075_8082.cpp:116:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
  116 |                         ans[arr[i]] = max(ans[arr[i]], ans[arr[i] - difference] + 1);
      |                         ^~~
      |                         abs


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-30 00:20:44, Gzip enabled