博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【模拟】BAPC2014 G Growling Gears (Codeforces GYM 100526)
阅读量:4665 次
发布时间:2019-06-09

本文共 1433 字,大约阅读时间需要 4 分钟。

题目链接:

  

  

题目大意:

  N条开口朝下的抛物线T = -aR2 + bR + c,求哪条抛物线最高的点最高。

题目思路:

  【模拟】

  直接取x=b/2a带入抛物线计算最高点记录答案。

 

1 // 2 //by coolxxx 3 //#include
4 #include
5 #include
6 #include
7 #include
8 #include
9 #include
10 #include
11 #include
12 #include
13 #include
14 //#include
15 #include
16 #define min(a,b) ((a)<(b)?(a):(b))17 #define max(a,b) ((a)>(b)?(a):(b))18 #define abs(a) ((a)>0?(a):(-(a)))19 #define lowbit(a) (a&(-a))20 #define sqr(a) ((a)*(a))21 #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))22 #define mem(a,b) memset(a,b,sizeof(a))23 #define eps (1e-8)24 #define J 1025 #define mod 100000000726 #define MAX 0x7f7f7f7f27 #define PI 3.1415926535897932328 #define N 10429 using namespace std;30 typedef long long LL;31 int cas,cass;32 int n,m,lll,ans;33 int num,a,b,c;34 double anss;35 int main()36 {37 #ifndef ONLINE_JUDGE38 // freopen("1.txt","r",stdin);39 // freopen("2.txt","w",stdout);40 #endif41 int i,j,k;42 double x,y;43 for(scanf("%d",&cas);cas;cas--)44 // for(scanf("%d",&cas),cass=1;cass<=cas;cass++)45 // while(~scanf("%s",s+1))46 // while(~scanf("%d",&n))47 {48 scanf("%d",&n);49 anss=-10000*10000-10000*5000-10000;num=0;50 for(i=1;i<=n;i++)51 {52 scanf("%d%d%d",&a,&b,&c);53 x=b;54 x=x/2.0/a;55 y=-a*x*x+b*x+c;56 if(anss
View Code

 

转载于:https://www.cnblogs.com/Coolxxx/p/5805152.html

你可能感兴趣的文章
wget使用小技巧
查看>>
个推持续集成最佳实践
查看>>
个推 Spark实践教你绕过开发那些“坑”
查看>>
CoreData简单使用
查看>>
linux服务器---squid缓存
查看>>
Ubuntu学习笔记(3)-常用的命令记录
查看>>
Windy数
查看>>
平衡树-初步总结
查看>>
k8s 英文文档翻译
查看>>
Python os模块
查看>>
jQuery中addClass不起作用
查看>>
python--关于函数传递
查看>>
产品经理与项目经理
查看>>
50. 分别使用迭代或递归来实现对数组的二分查找(折半查找)
查看>>
造成 nginx 403 forbidden 的几种原因
查看>>
url-safe base64 && base64
查看>>
KVM虚拟化技术
查看>>
数据库原理--数据库系统基础
查看>>
LETTers比赛第七场 Qin Shi Huang's National Road System
查看>>
C1TrueGrid 添加行索引
查看>>