码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 倒计时39天


    牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ (nowcoder.com)

    1. //m
    2. #include
    3. using namespace std;
    4. const int N=1e5+5;
    5. const int inf=0x3f3f3f3f;
    6. #define int long long
    7. int a[N],b[N];
    8. void solve()
    9. {
    10. int n,cn=0;
    11. cin>>n;
    12. for(int i=1;i<=n;i++)
    13. {
    14. cin>>a[i];
    15. b[a[i]%36]++;
    16. }
    17. for(int i=1;i<=n;i++)
    18. {
    19. int r=a[i];
    20. int c=1;
    21. while(r)
    22. {
    23. c*=10;
    24. r/=10;
    25. }
    26. for(int j=0;j<=35;j++)
    27. {
    28. if(((j*(c%36))%36+a[i]%36)%36==0)
    29. {
    30. cn+=b[j]-(a[i]%36==j);
    31. }
    32. }
    33. }
    34. cout<
    35. }
    36. signed main()
    37. {
    38. ios_base::sync_with_stdio(false);
    39. cin.tie(nullptr);
    40. cout.tie(nullptr);
    41. int t;
    42. //cin>>t;
    43. t=1;
    44. while(t--)
    45. {
    46. solve();
    47. }
    48. return 0;
    49. }

    牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ (nowcoder.com)

    1. //d
    2. #include
    3. using namespace std;
    4. #define int long long
    5. const int N=2e5+6;
    6. const int inf=0x3f3f3f3f;
    7. int a[N];
    8. void solve()
    9. {
    10. int n,cn=0;
    11. cin>>n;
    12. for(int i=0;i
    13. {
    14. cin>>a[i];
    15. cn+=a[i];
    16. }
    17. if(n==1)
    18. {
    19. cout<<1<
    20. return ;
    21. }
    22. int cnt=0;
    23. for(int i=1;i<=cn/n;i++)
    24. {
    25. if(cn%i==0)cnt++;
    26. }
    27. cout<
    28. }
    29. signed main()
    30. {
    31. ios_base::sync_with_stdio(false);
    32. cin.tie(nullptr),cout.tie(nullptr);
    33. int t=1;
    34. //cin>>t;
    35. while(t--)
    36. {
    37. solve();
    38. }
    39. return 0;
    40. }
    41. //e
    42. #include
    43. using namespace std;
    44. #define int long long
    45. const int N=2e5+6;
    46. const int inf=0x3f3f3f3f;
    47. map<int,int>mp;
    48. void solve()
    49. {
    50. int n,k,x,cn=0,cnt=0;
    51. cin>>n>>k;
    52. for(int i=0;i
    53. {
    54. cin>>x;
    55. cn+=x;
    56. if(cn%k==0||mp[cn%k])
    57. {
    58. cnt++;
    59. mp.clear();
    60. cn=0;
    61. }
    62. else mp[cn%k]=1;
    63. }
    64. cout<
    65. }
    66. signed main()
    67. {
    68. ios_base::sync_with_stdio(false);
    69. cin.tie(nullptr),cout.tie(nullptr);
    70. int t=1;
    71. //cin>>t;
    72. while(t--)
    73. {
    74. solve();
    75. }
    76. return 0;
    77. }
    78. //g
    79. #include
    80. using namespace std;
    81. #define int long long
    82. const int N=2e5+6;
    83. const int inf=0x3f3f3f3f;
    84. char s[510][510];
    85. int sum[510][510];
    86. void solve()
    87. {
    88. int n,m;
    89. cin>>n>>m;
    90. for(int i=1;i<=n;i++)
    91. {
    92. for(int j=1;j<=m;j++)
    93. {
    94. cin>>s[i][j];
    95. if(s[i][j]=='*')
    96. {
    97. sum[i][j]=sum[i][j-1]+1;
    98. }
    99. else sum[i][j]=sum[i][j-1];
    100. }
    101. }
    102. int ans=0;
    103. for(int i=1;i<=n;i++)
    104. {
    105. for(int j=1;j<=m;j++)
    106. {
    107. for(int k=1;k<=n;k++)
    108. {
    109. if(s[i+k][j+k]!='*'||s[i+k][j-k]!='*'||s[i][j]!='*')break;
    110. if(sum[i+k][j+k]-sum[i+k][j-k-1]==2*k+1)ans++;
    111. }
    112. }
    113. }
    114. cout<
    115. }
    116. signed main()
    117. {
    118. ios_base::sync_with_stdio(false);
    119. cin.tie(nullptr),cout.tie(nullptr);
    120. int t=1;
    121. //cin>>t;
    122. while(t--)
    123. {
    124. solve();
    125. }
    126. return 0;
    127. }

  • 相关阅读:
    【服务器搭建】教程一:没钱买服务器怎么玩 进来看
    数据结构题 3(一元多项式计算器)
    Maven setting配置文件
    密码保护工具的编写
    Spring框架中的核心技术之AOP
    【SLAM数学基础】李群与李代数 & BCH近似公式
    【状语从句练习题】whoever / whatever / wherever / whenever / however
    Spring Boot 内置工具类 ObjectUtils
    总结使用React做过的一些优化
    前端架构师之02_ES6_高级
  • 原文地址:https://blog.csdn.net/fkuelntxgt/article/details/136379045
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号