题目链接:

  http://codeforces.com/gym/100526

  http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11670&courseid=0

题目大意:

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

题目思路:

  【模拟】

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

 //
//by coolxxx
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<map>
#include<memory.h>
#include<time.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//#include<stdbool.h>
#include<math.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)>0?(a):(-(a)))
#define lowbit(a) (a&(-a))
#define sqr(a) ((a)*(a))
#define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
#define mem(a,b) memset(a,b,sizeof(a))
#define eps (1e-8)
#define J 10
#define mod 1000000007
#define MAX 0x7f7f7f7f
#define PI 3.14159265358979323
#define N 104
using namespace std;
typedef long long LL;
int cas,cass;
int n,m,lll,ans;
int num,a,b,c;
double anss;
int main()
{
#ifndef ONLINE_JUDGE
// freopen("1.txt","r",stdin);
// freopen("2.txt","w",stdout);
#endif
int i,j,k;
double x,y;
for(scanf("%d",&cas);cas;cas--)
// for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
// while(~scanf("%s",s+1))
// while(~scanf("%d",&n))
{
scanf("%d",&n);
anss=-*-*-;num=;
for(i=;i<=n;i++)
{
scanf("%d%d%d",&a,&b,&c);
x=b;
x=x/2.0/a;
y=-a*x*x+b*x+c;
if(anss<y)
{
anss=y;
num=i;
}
}
printf("%d\n",num);
}
return ;
}
/*
// //
*/

【模拟】BAPC2014 G Growling Gears (Codeforces GYM 100526)的更多相关文章

  1. 【线段树】BAPC2014 E Excellent Engineers (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  2. 【扩展欧几里得】BAPC2014 I Interesting Integers (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  3. 【宽搜】BAPC2014 J Jury Jeopardy (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  4. 【最短路】BAPC2014 B Button Bashing (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  5. 【中途相遇法】【STL】BAPC2014 K Key to Knowledge (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  6. 【最大流】BAPC2014 A Avoiding the Apocalypse (Codeforces GYM 100526)

    题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...

  7. Growling Gears

    http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11587 G Growling GearsThe Best A ...

  8. Codeforces Gym 101190M Mole Tunnels - 费用流

    题目传送门 传送门 题目大意 $m$只鼹鼠有$n$个巢穴,$n - 1$条长度为$1$的通道将它们连通且第$i(i > 1)$个巢穴与第$\left\lfloor \frac{i}{2}\rig ...

  9. Codeforces Gym 101623A - 动态规划

    题目传送门 传送门 题目大意 给定一个长度为$n$的序列,要求划分成最少的段数,然后将这些段排序使得新序列单调不减. 考虑将相邻的相等的数缩成一个数. 假设没有分成了$n$段,考虑最少能够减少多少划分 ...

随机推荐

  1. PRD产品需求文档概要

    PRD概念 PRM就是Product Requirements Document的简称,也就是产品需求模型.一般来说一个产品会伴随有市场需求文档(Market Requirements Documen ...

  2. oracle在linux配置信息

    这两天在linux中给已有的oracle添加新实例,其中涉及数据库服务.监听配置,oracle服务是否正常.监听是否成功等操作,特此记录存档,以备后用. oracle服务启动操作命令 1.查看orac ...

  3. 对象-关系映射ORM(Object Relational Mapping)(转)

    ORM的实现思想就是将关系数据库中表的数据映射成对象,以对象的形式展现 Hibernate在实现ORM功能的时候主要用到的文件有:映射类(*.java).映射文件(*.hbm.xml)和数据库配置文件 ...

  4. oracle中创建表时添加注释

    CREATE TABLE t1(id varchar2(32) primary key,name VARCHAR2(32) ,age VARCHAR2(32) );comment on column ...

  5. 读取xml时,遇到xmlns的问题

    1.读取xml的时候,由于xml里有xmlns的属性,导致了读xml无法正常读取.通过网上搜索,发现需要先注册命名空间.  xmlns是XML Namespaces的缩写,中文名称是XML(标准通用标 ...

  6. Xcode添加静态库以及编译选项配置常见问题

    一,Xcode编译出现Link错误,出现"duplicate symbols for architecture i386 clang"提示.问题:链接时,项目有重名文件.解决:根据 ...

  7. Spring_DI利用set方法赋值Demo

    Person.java public class Person { private Long pid; private String pname; private Student student; p ...

  8. PS2251-07 海力士(金士顿U盘量产,成功!)

    U盘挂掉了,用芯片无忧测到是这个样子的,看到是PS2251-07 海力士的 网上找了很多方法都不成功,最后找到了两个可以量产成功的方法,建议使用第一种. 首先,附上三个检测工具 芯片无忧.GetInf ...

  9. 浅谈dataGridView使用,以及画面布局使用属性,对datagridview进行增删改查操作,以及委托使用技巧

        通过几天的努力后,对datagridview使用作一些简要的介绍,该实例主要运用与通过对datagridview操作.对数据进行增删改查操作时,进行逻辑判断执行相关操作.简单的使用委托功能,实 ...

  10. Django db relationship

    # coding=utf-8 from django.db import models """ Django数据库关系: 一对一关系:OneToOneField 多对多关 ...