Ignatius and the Princess IV HDU - 1029
题意是n个数,输出出现次数大于n+1/2 的数(n为奇数)
计数输出。。
网上有做法是排序然后直接输出中位数,感觉很有道理。。
#include
using namespace std;
int main(){
int n;
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
while(
原创
2017-05-21 09:54:38 ·
170 阅读 ·
0 评论