全部wa,但是测试数据下载自测是对的

P1464 Function

···cpp #include<iostream> #include<fstream> using namespace std; long long m[30][30][30]; long long w(long long a, long long b, long long c) { if(a<=0||b<=0||c<=0) return 1; else if(m[a][b][c]!=0) return m[a][b][c]; else if(a>20||b>20||c>20) m[a][b][c]=w(20,20,20); else if(a<b&&b<c) m[a][b][c]=w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c); else m[a][b][c]=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 af,bf,cf; ofstream fout("fuck.txt"); while(cin>>af>>bf>>cf&&(af!=-1||bf!=-1||cf!=-1)) { for(int i=0;i<30;i++) for(int j=0;j<30;j++) for(int k=0;k<30;k++) m[i][j][k]=0; fout<<"w("<<af<<", "<<bf<<", "<<cf<<") = "; if(af<=0||bf<=0||cf<=0) af=bf=cf=0; if(af>20||bf>20||cf>20) af=bf=cf=21; fout<<w(af,bf,cf)<<endl; } fout.close(); return 0; } ···
by yinghy18 @ 2018-12-30 17:54:03


希望更丰富的展现?使用Markdown ```cpp #include<iostream> #include<fstream> using namespace std; long long m[30][30][30]; long long w(long long a, long long b, long long c) { if(a<=0||b<=0||c<=0) return 1; else if(m[a][b][c]!=0) return m[a][b][c]; else if(a>20||b>20||c>20) m[a][b][c]=w(20,20,20); else if(a<b&&b<c) m[a][b][c]=w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c); else m[a][b][c]=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 af,bf,cf; ofstream fout("fuck.txt"); while(cin>>af>>bf>>cf&&(af!=-1||bf!=-1||cf!=-1)) { for(int i=0;i<30;i++) for(int j=0;j<30;j++) for(int k=0;k<30;k++) m[i][j][k]=0; fout<<"w("<<af<<", "<<bf<<", "<<cf<<") = "; if(af<=0||bf<=0||cf<=0) af=bf=cf=0; if(af>20||bf>20||cf>20) af=bf=cf=21; fout<<w(af,bf,cf)<<endl; } fout.close(); return 0; } ```
by yizimi远欣 @ 2018-12-30 17:55:52


那个,,,交题时带着个了? ```cpp ofstream fout("fuck.txt"); fout.close(); ```
by yizimi远欣 @ 2018-12-30 17:56:43


~~这优雅的文件名~~
by Chiyoda_Momo @ 2018-12-30 18:01:31


|