#include<bits/stdc++.h>
#define int long long
using namespace std;const int inf=1e5+10;
#define endl '\n'
struct node{
int a,b,c;
};
// unordered_map<node,int>q;
int w(node root)
{
// if(q.count(root))return q[root];
if(root.c<=0||root.b<=0||root.a<=0){return 1;}
if(root.c>20||root.b>20||root.a>20){root.c=20,root.b=20,root.a=20;}
if(root.a<root.b&&root.b<root.c){
int k=w({root.a,root.b,root.c-1})+w({root.a,root.b-1,root.c-1})+w({root.a,root.b-1,root.c});
// q[root]=k;
return k;
}
else{
int k=w({root.a-1,root.b,root.c})+w({root.a-1,root.b-1,root.c})+w({root.a-1,root.b,root.c-1})-w({root.a-1,root.b-1,root.c-1});
// q[root]=k;
return k;
}
}
signed main()
{
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
node root;
while (cin>>root.a>>root.b>>root.c,!(root.c==-1&&root.b==-1&&root.a==-1))
{
node copy=root;
int ans=w(root);
printf("w(%lld, %lld, %lld) = %lld\n",copy.a,copy.b,copy.c,ans);
}
return 0;
}
报错放这
[Error] use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = node; _Tp = long long int; _Hash = std::hash<node>; _Pred = std::equal_to<node>; _Alloc = std::allocator<std::pair<const node, long long int> >]'
[Error] use of deleted function 'std::hash<node>::hash()'
[Error] 'std::__hash_enum<_Tp, <anonymous> >::~__hash_enum() [with _Tp = node; bool <anonymous> = false]' is private within this context
(其实出现一堆东西指向编译器,但是太多就不复制了
类似 from D:/Dev-Cpp/MinGW32/include/c++/10.2.0/string
In file included from D:/Dev-Cpp/MinGW32/include/c++/10.2.0/bits/basic_string.h)
问题应该是那四行注释掉的代码导致的