题目链接:1058--1067

http://xcacm.hfut.edu.cn/problemset.php#

省赛题其实并不难。。。练手速用。。。

 

1062:

感觉是先离散化,然后从点向上下左右四个方向发射线,看和边相交的次数

1063: 4min

 1 //4min
 2 
 3 #include <iostream>
 4 #include <algorithm>
 5 #include<cstdio>
 6 using namespace std;
 7 int N,t;
 8 double ans;
 9 double a[10010];
10 
11 int main()
12 {
13     while(cin>>N)
14     {
15         for (int i=0;i<N;i++)
16             cin>>a[i];
17 
18         sort(a,a+N);
19         //for (int i=0;i<N;i++)   cout<<a[i]<<" ";
20         t=N/2-1;
21         if (N%2!=0)
22             ans=a[t+1];
23         else
24             ans=(a[t]+a[t+1])/2;
25 
26         printf("%.2lf\n",ans);
27     }
28 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-07-24
  • 2021-11-12
  • 2021-07-01
  • 2021-11-29
  • 2021-05-27
猜你喜欢
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-05-25
  • 2021-07-07
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案