林鱼 发表于 2026-1-20 15:45:01

C++算法训练第八天

C++算法训练第八天

以下为牛客挑战
今日收获

学习到了ksm的写法int ksm(int p,int q,int mod){    int result=1;    p=p%mod;    while (q>0){      if(q&1){//            result=(1ll*result*p)%mod;      }      q=q>>1;      p=(1ll*p*p)%mod;    }    return result%mod;}知道了滚动数组先有一个数组,然后在操作时候弄一个一样的数组,dp转移完成之后,直接赋值回最先的数组。为了节省空间。练习了一下BFS搜图【算法竞赛知识点-数学】:快速幂_哔哩哔哩_bilibili
牛客周赛 Round 127

(36条未读私信) 牛客竞赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ (nowcoder.com)
Get The Number

A-Get The Number_牛客周赛 Round 127 (nowcoder.com)
https://img2024.cnblogs.com/blog/3621557/202601/3621557-20260120150533505-1288038220.png
解题代码

#include#define int long long#define lll __uint128_t#define PII pair#define endl '\n'using namespace std;#define yn(ans) printf("%s\n", (ans)?"Yes":"No");//快速打印#define YN(ans) printf("%s\n", (ans)?"YES":"NO");#define REP(i, e) for (int i = 0; i < (e); ++i)#define REP1(i, s, e) for (int i = (s); i > t; while (t--)#define TESTconst int N=2e5+10,M=1e3+10,mod=1e9+7;int a,b,c,pre;signed main(){        std::ios::sync_with_stdio(false);    cin.tie(0);    cout.tie(0);    int n,m,x;    cin>>n>>m>>x;    if(x==(n+m)||(n-m)==x ||((n/m==x)&&(m*x==n))){      cout

但婆 发表于 2026-2-2 02:18:52

懂技术并乐意极积无私分享的人越来越少。珍惜

茹静曼 发表于 2026-2-3 08:49:15

收藏一下   不知道什么时候能用到

奸轲嫣 发表于 2026-2-4 10:39:25

喜欢鼓捣这些软件,现在用得少,谢谢分享!

松菊 发表于 2026-2-5 05:55:41

分享、互助 让互联网精神温暖你我

敛饺乖 发表于 2026-2-5 11:46:11

感谢分享

伯绮梦 发表于 2026-2-8 03:25:21

感谢发布原创作品,程序园因你更精彩

艾曼语 发表于 2026-2-9 17:21:34

感谢,下载保存了

钱闲华 发表于 2026-2-10 10:58:14

谢谢楼主提供!

蔬陶 发表于 2026-2-13 08:17:57

过来提前占个楼

巫雪艷 发表于 2026-2-25 05:07:29

东西不错很实用谢谢分享

巴沛若 发表于 2026-2-25 20:49:48

前排留名,哈哈哈

梦霉 发表于 2026-2-25 21:36:49

东西不错很实用谢谢分享

丘娅楠 发表于 2026-2-27 01:04:57

东西不错很实用谢谢分享

接快背 发表于 2026-3-2 13:15:33

谢谢分享,试用一下

莘度 发表于 2026-3-9 10:28:51

前排留名,哈哈哈

欧阳雪枫 发表于 3 天前

热心回复!
页: [1]
查看完整版本: C++算法训练第八天