编写题解 2973: 出现次数超过一半的数 摘要:解题思路:先计数排序 再判断注意事项:参考代码:#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=…… 题解列表 2024年07月22日 0 点赞 0 评论 545 浏览 评分:9.9
题解 2973: 出现次数超过一半的数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int n,tong[1003];int main(){ cin>>n; for(…… 题解列表 2024年07月16日 0 点赞 0 评论 469 浏览 评分:0.0
2973: 出现次数超过一半的数 解题思路:注意事项:参考代码:#includeusingnamespacestd;typedeflonglongll;constllN=1e5;inttong[N];intmain(){intn;cin>>n;for(inti=1;i<=n;i++){inta;cin>>a;tong[a+50]++; 题解列表 2024年07月15日 0 点赞 0 评论 460 浏览 评分:9.9
2973: 出现次数超过一半的数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int tong[1005];int main(){ int n; c…… 题解列表 2023年10月21日 0 点赞 0 评论 629 浏览 评分:0.0
2973: 出现次数超过一半的数 ```cpp//这道题我是用桶的思想去做的//有一点需要注意,是n的范围,从-50开始,但数组的下标是不会有负数的所以加上50即可#includeusingnamespacestd;inta[1001],b[2000],n,f;intmain(){cin>>n;for(inti=1;i>a[i];b[ 题解列表 2023年03月11日 0 点赞 0 评论 599 浏览 评分:9.9
2973: 出现次数超过一半的数 ```cpp#include#includeusingnamespacestd;intmain(){inta[1001],b[1001],n;memset(b,0,sizeof(b));cin>>n;for(inti=0;i>a[i];a[i]+=50;++b[a[i]];}for(inti=0;in 题解列表 2023年02月17日 0 点赞 0 评论 506 浏览 评分:9.9
没人写,就我来吧。 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n,t,b[1005]={0}; cin>>n; i…… 题解列表 2022年10月24日 0 点赞 0 评论 569 浏览 评分:9.9