BAPC2014 g&&hunnu11587:growling Gears

Source: Internet
Author: User

Test instructions

gives the a,b,c of N open-ended parabolic, which is the highest parabola of the output vertex.


Ideas:

The direct parabolic formula is calculated


#include <iostream> #include <stdio.h> #include <string.h> #include <stack> #include <queue > #include <map> #include <set> #include <vector> #include <math.h> #include <bitset># Include <algorithm> #include <climits>using namespace std; #define LS 2*i#define rs 2*i+1#define up (i,x,y) for (i=x;i<=y;i++) #define DOWN (i,x,y) for (i=x;i>=y;i--) #define MEM (a,x) memset (A,x,sizeof (a)) #define W (a) while (a)  #define GCD (A, B) __gcd (A, b) #define LL long long#define ULL unsigned long long#define N 100005#define INF 0x3f3f3f3f#define    EXP 1e-8#define rank rank1const int mod = 1000000007;int main () {int t,a,b,c,n;    scanf ("%d", &t);        while (t--) {double maxn=-inf;        int aa=0;        Double x,sum;        scanf ("%d", &n);            for (int i=1;i<=n;i++) {scanf ("%d%d%d", &a,&b,&c);            A=-a;            sum= (4*a*c-b*b)/(4.0*A);                if (SUM&GT;MAXN) {Maxn=sum;            Aa=i;    }} printf ("%d\n", AA); } return 0;}


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

BAPC2014 g&&hunnu11587:growling Gears

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.