您或許執行了不正確的系統指令。 /4945760/code_4945760.exe: error while loading shared libraries: libgcc_s.so.1: failed to map segment from shared object
AC (53ms, 51.2MB)
不知道為什麼,程式碼:
#include <iostream>
using namespace std;
int ans[20001][667];
int main(){
int cin0,temp;
bool flag;
for(int a=0;a<20001;++a) for(int b=0;b<667;++b) ans[a][b]=0;
ans[1][666]=1,ans[2][666]=1;
for(int a=3;a<=20000;++a){
for(int b=666;b>=0;--b){
if(!ans[a-1][b]&&!ans[a-2][b]) break;
ans[a][b]+=ans[a-1][b]+ans[a-2][b];
if(ans[a][b]>999999999) ++ans[a][b-1],ans[a][b]-=1000000000;
}
}
while(cin>>cin0){
if(!cin0){
cout<<"0\n";
continue;
}
flag=false;
for(int a=0;a<=666;++a){
if(flag){
if(ans[cin0][a]<100000000){
if(10000000<=ans[cin0][a]&&ans[cin0][a]<=99999999) cout<<'0';
else if(1000000<=ans[cin0][a]&&ans[cin0][a]<=9999999) cout<<"00";
else if(100000<=ans[cin0][a]&&ans[cin0][a]<=999999) cout<<"000";
else if(10000<=ans[cin0][a]&&ans[cin0][a]<=99999) cout<<"0000";
else if(1000<=ans[cin0][a]&&ans[cin0][a]<=9999) cout<<"00000";
else if(100<=ans[cin0][a]&&ans[cin0][a]<=999) cout<<"000000";
else if(10<=ans[cin0][a]&&ans[cin0][a]<=99) cout<<"0000000";
else cout<<"00000000";
}
cout<<ans[cin0][a];
}else if(ans[cin0][a]){
flag=true;
cout<<ans[cin0][a];
}
}
cout<<'\n';
}
}
您或許執行了不正確的系統指令。 /4945760/code_4945760.exe: error while loading shared libraries: libgcc_s.so.1: failed to map segment from shared object
AC (53ms, 51.2MB)
不知道為什麼,程式碼:
#include
using namespace std;
int ans[20001][667];
int main(){
int cin0,temp;
bool flag;
for(int a=0;a<20001;++a) for(int b=0;b<667;++b) ans[a][b]=0;
ans[1][666]=1,ans[2][666]=1;
for(int a=3;a<=20000;++a){
for(int b=666;b>=0;--b){
if(!ans[a-1][b]&&!ans[a-2][b]) break;
ans[a][b]+=ans[a-1][b]+ans[a-2][b];
if(ans[a][b]>999999999) ++ans[a][b-1],ans[a][b]-=1000000000;
}
}
while(cin>>cin0){
if(!cin0){
cout<<"0\n";
continue;
}
flag=false;
for(int a=0;a<=666;++a){
if(flag){
if(ans[cin0][a]<100000000){
if(10000000<=ans[cin0][a]&&ans[cin0][a]<=99999999) cout<<'0';
else if(1000000<=ans[cin0][a]&&ans[cin0][a]<=9999999) cout<<"00";
else if(100000<=ans[cin0][a]&&ans[cin0][a]<=999999) cout<<"000";
else if(10000<=ans[cin0][a]&&ans[cin0][a]<=99999) cout<<"0000";
else if(1000<=ans[cin0][a]&&ans[cin0][a]<=9999) cout<<"00000";
else if(100<=ans[cin0][a]&&ans[cin0][a]<=999) cout<<"000000";
else if(10<=ans[cin0][a]&&ans[cin0][a]<=99) cout<<"0000000";
else cout<<"00000000";
}
cout<<ans[cin0][a];
}else if(ans[cin0][a]){
flag=true;
cout<<ans[cin0][a];
}
}
cout<<'\n';
}
}
測試執行只開的下 10^7 個 int,所以 20001*667>10^7 會 RE(code:127) 或 MLE
實際送出則是看這題的記憶體限制有多大,這題是512MB,所以就AC了