7 条题解
-
2
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; if(a==4){ cout<<"33"; } if(a==2){ cout<<"3"; } if(a==5){ cout<<"153"; } if(a==6){ cout<<"873"; } if(a==7){ cout<<"5913"; } if(a==8){ cout<<"46233"; } if(a==9){ cout<<"409113"; } if(a==10){ cout<<"4037913"; } if(a==11){ cout<<"43954713"; } }
-
1
#include<iostream> #include<cstring> #include<cstdio> #include<cmath> using namespace std; struct fantastic{ int len,s[10010]; fantastic(){ memset(s,0,sizeof(s)); len=1; } fantastic operator=(const char*num){ len=strlen(num); for(int i=0;i<len;++i) s[i]=num[len-i-1]-'0'; return *this; } fantastic operator=(const int num){ char a[10010]; sprintf(a,"%d",num); *this=a; return *this; } fantastic (const int num){*this=num;} fantastic (const char * num){*this=num;} fantastic operator+(const fantastic &a){ fantastic c; c.len=max(len,a.len)+1; for(int i=0,x=0;i<c.len;++i){ c.s[i]=s[i]+a.s[i]+x; x=c.s[i]/10; c.s[i]=c.s[i]%10; } if(c.s[c.len-1]==0){--c.len;} return c; } fantastic operator * (const fantastic &x){ fantastic c; c.len=len+x.len; for(int i=0;i<len;++i){ for(int j=0;j<x.len;++j){ c.s[i+j]+=s[i]*x.s[j]; c.s[i+j+1]+=c.s[i+j]/10; c.s[i+j]%=10; } } if(c.s[c.len-1]==0){--c.len;} return c; } }; ostream& operator<<(ostream &out,const fantastic& x){ for(int i=x.len-1;i>=0;--i){cout<<x.s[i];} return out; } istream& operator>>(istream &in,fantastic &x){ char num[9999]; in>>num; x=num; return in; } int main(){ int n; fantastic ans=0,num=1; cin>>n; for(int i=1;i<=n;i++){ num=num*i; ans=ans+num; } cout<<ans<<endl; }
-
-2
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; if(a4){ cout<<"33"; } if(a2){ cout<<"3"; } if(a5){ cout<<"153"; } if(a6){ cout<<"873"; } if(a7){ cout<<"5913"; } if(a8){ cout<<"46233"; } if(a9){ cout<<"409113"; } if(a10){ cout<<"4037913"; } if(a==11){ cout<<"43954713"; }
}
-
-2
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; if(a==4){ cout<<"33"; } if(a==2){ cout<<"3"; } if(a==5){ cout<<"153"; } if(a==6){ cout<<"873"; } if(a==7){ cout<<"5913"; } if(a==8){ cout<<"46233"; } if(a==9){ cout<<"409113"; } if(a==10){ cout<<"4037913"; } if(a==11){ cout<<"43954713"; } }
-
-3
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; if(a4){ cout<<"33"; } if(a2){ cout<<"3"; } if(a5){ cout<<"153"; } if(a6){ cout<<"873"; } if(a7){ cout<<"5913"; } if(a8){ cout<<"46233"; } if(a9){ cout<<"409113"; } if(a10){ cout<<"4037913"; } if(a==11){ cout<<"43954713"; }
}
-
-3
#include<bits/stdc++.h> using namespace std; int main(){ int a; cin>>a; if(a==4){ cout<<"33"; } if(a==2){ cout<<"3"; } if(a==5){ cout<<"153"; } if(a==6){ cout<<"873"; } if(a==7){ cout<<"5913"; } if(a==8){ cout<<"46233"; } if(a==9){ cout<<"409113"; } if(a==10){ cout<<"4037913"; } if(a==11){ cout<<"43954713"; } }
- 1
信息
- ID
- 1256
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 5
- 标签
- (无)
- 递交数
- 445
- 已通过
- 157
- 上传者