Why??全部wa,求助

P1464 Function

请示出题干
by ZY_2007 @ 2019-01-20 20:38:46


除非你是Compile ERRor
by ZY_2007 @ 2019-01-20 20:39:17


这是我实验和下载的测试数据(害我费了1次尝试机会和两次测试数据下载资格)。 输入: 0 0 0 1 1 1 2 2 2 10 4 6 50 50 50 -1 7 18 17 17 18 19 17 18 21 -21 20 -1 -1 -11 -1 -1 -1 输出: w(0, 0, 0) = 1 w(1, 1, 1) = 2 w(2, 2, 2) = 4 w(10, 4, 6) = 523 w(50, 50, 50) = 1048576 w(-1, 7, 18) = 1 w(17, 17, 18) = 131072 w(19, 17, 18) = 524271 w(21, -21, 20) = 1 w(-1, -1, -11) = 1
by ZY_2007 @ 2019-01-20 20:51:19


@[颜正元](/space/show?uid=152762) 呃,当我没说
by ZY_2007 @ 2019-01-20 20:51:42


```cpp #include <iostream> #include <stdio.h> #include <math.h> #include <string.h> #include <algorithm> #include <vector> using namespace std; int w(long long a, long long b, long long c){ if(a <= 0 || b <= 0 || c <= 0) return 1; else if(a > 20 || b > 20 || c > 20) return w(20, 20, 20); else if(a<b&&b<c) w(a,b,c−1)+w(a,b−1,c−1)−w(a,b−1,c); else return w(a−1,b,c)+w(a−1,b−1,c)+w(a−1,b,c−1)−w(a−1,b−1,c−1); } } int main(){ long long x,y,z,j; vector<long long> aa(1,0),ab(1,0),ac(1,0); aa.erase(0); ab.erase(0); ac.erase(0); while 1:{ cin>>x,y,z; if(x==-1&&y==-1&&z==-1) break; aa.push_back(x); ab.push_back(y); ac.push_back(z); j+=1; } for(int i=0;i<j;i++) printf("w(%lld, %lld, %lld) = ",aa[i],ab[i],ac[i]); } ```
by ZY_2007 @ 2019-01-20 22:12:20


改好了,谢谢
by 青竹 @ 2019-01-21 12:39:41


@[颜正元](/space/show?uid=152762) 大佬!
by Mickey_jj @ 2019-02-08 17:02:53


@[Mickey_jj](/space/show?uid=150249) 过奖了,我只是个蒟蒻
by ZY_2007 @ 2019-02-11 14:07:31


@[颜正元](/space/show?uid=152762) 感谢大佬!
by 洛の神 @ 2019-03-06 19:24:15


呵呵?
by ZY_2007 @ 2019-03-17 14:22:29


|