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_39829717_32570.cpp: In function 'int calculateProbability(const std::vector<int>&, const std::vector<int>&, int)':
0_0_39829717_32570.cpp:14:5: error: 'function' was not declared in this scope
   14 |     function<int(int, int)> dp = [&](int l, int r) {
      |     ^~~~~~~~
0_0_39829717_32570.cpp:4:1: note: 'std::function' is defined in header '<functional>'; did you forget to '#include <functional>'?
    3 | #include <unordered_map>
  +++ |+#include <functional>
    4 | using namespace std;
0_0_39829717_32570.cpp:14:26: error: expression list treated as compound expression in functional cast [-fpermissive]
   14 |     function<int(int, int)> dp = [&](int l, int r) {
      |                          ^
0_0_39829717_32570.cpp:14:14: error: expected primary-expression before 'int'
   14 |     function<int(int, int)> dp = [&](int l, int r) {
      |              ^~~
0_0_39829717_32570.cpp:33:18: error: 'dp' was not declared in this scope; did you mean 'p'?
   33 |     int result = dp(0, n - 1);
      |                  ^~
      |                  p


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-25 19:23:18, Gzip enabled