acgo题库
  • 首页
  • 题库
  • 学习
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情提交记录(0)
  • 题解

    userId_undefined

    侯

    149阅读
    2回复
    0点赞
  • 多种解法 题解 100% AC

    1. 高精度: 2. 预处理:

    userId_undefined

    飞的智动

    时空双修者出道萌新8月全勤卷王题解仙人秩序白银快乐小狗
    15阅读
    0回复
    1点赞
  • 直接拿下

    #include<iostream> #include<vector> using namespace std; struct node{ int num,a; }; vector<vector<int>> mp; int t,m; void js(int maxn){ mp.resize(maxn + 5); mp[0] = {1}; mp[1] = {1}; for(int i = 2;i <= maxn;i++){ mp[i] = mp[i - 1]; int c = 0; for(int j = 0;j < mp[i].size();j++){ int product = mp[i][j] * i + c; mp[i][j] = product % 10; c = product / 10; } while(c){ mp[i].push_back(c % 10); c /= 10; } } } void out(node o){ int x = o.num,a = o.a,ans = 0; for(auto i : mp[x]) ans += (i == a); cout << ans << endl; } int main(){ vector<node> a; cin >> t; while(t--){ int x,y; cin >> x >> y; a.push_back({x,y}); m = max(m,x); } js(m); for(auto i : a){ out(i); } return 0; }

    userId_undefined

    137****0822

    秩序白银时间刺客空间掌握者时空双修者9月全勤卷王快乐小狗
    1阅读
    0回复
    0点赞
  • 题解

    #include<bits/stdc++.h> using namespace std; int n[10001], s, t, m, x, y, cnt, yu; void lgx(int t) { n[1]=1; s=1; for(int i=1;i<=t;i++) { yu=0; for(int j=1;j<=s;j++) { n[j]=n[j]*i+yu; yu=n[j]/10; n[j]%=10; } n[s+1]+=yu; while(n[s+1]) { if(n[s+1]>=10) { n[s+2]=n[s+1]/10; n[s+1]%=10; } s++; } } } int main() { cin>>m; for(int i=1;i<=m;i++) { memset(n,0,sizeof(n)); cnt=0; cin >> x >> y; lgx(x); for (int j=s;j>=1;j--) if (y==n[j]) cnt++; printf("%d\n",cnt); } return 0; }

    userId_undefined

    6

    递归·套娃学徒贪心·贪心尝试者
    7阅读
    0回复
    0点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页