题解列表

筛选

题解 2836: 数组逆序重放

解题思路:在正向循环后需要有有一个反向循环注意事项:参考代码:#includeusingnamespacestd;typedeflonglongll;constintN=1e7;lla[N];intmain(){lln;cin>>n;for(inti=1;i<=n;i++

2836: 数组逆序重放题解

解题思路:注意事项:参考代码#includeusingnamespacestd;typedeflonglongll;constintN=1e7;lla[N];intmain(){lln;cin>>n;for(inti=1;i<=n;i++)cin>>a[i];for(in

2836: 数组逆序重放题解

解题思路:注意事项:参考代码#includeusingnamespacestd;typedeflonglongll;constintN=1e7;lla[N];intmain(){lln;cin>>n;for(inti=1;i<=n;i++)cin>>a[i];for(in

编写题解 1997: 日期换算

解题思路:使用月份数组注意事项:输出时不只要输出sum,还要输出y。参考代码:#includeusingnamespacestd;typedeflonglongll;constintN=1e7;lla[N]={0,

1997: 日期换算题解

解题思路:注意事项:参考代码:#includeusingnamespacestd;typedeflonglongll;constintN=1e7;lla[N]={0,31,28,31,30,31,30,31,31,

(C++)题号1004:[递归]母牛的故事(可借鉴思路)

摘要:### 审题##### 题目说:“有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。”其中应该要知道的是:1.母牛最开始的一年里不生小母牛;2.小母牛……

二分+贪心+前缀和

摘要:```pythonn,x = map(int,input().split())x = 2*xh = list(map(int,input().split()))s = [0]*nf……

菜鸟代码,仅供参考

摘要:解题思路:对于两个整数aa和bb,它们的最大公约数(GCD)和最小公倍数(LCM)满足以下关系:GCD(a,b)×LCM(a,b)=a×bGCD(a,b)×LCM(……