World Finals 2015简要题解
来源:互联网 发布:国产浏览器知乎 编辑:程序博客网 时间:2024/06/06 08:53
A.Amalgamated Artichokes
题目链接
https://icpc.kattis.com/problems/artichoke
题目大意
定义数列
求
思路
直接暴力求出每一项的值,对于
代码
#include <iostream>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <algorithm>#include <cmath>#define MAXN 1100000using namespace std;int n;double p,a,b,c,d;double maxf=-1e20,minf=1e20;double ans=-1e20;int main(){ scanf("%lf%lf%lf%lf%lf%d",&p,&a,&b,&c,&d,&n); for(int i=1;i<=n;i++) { double f=p*(sin(a*i+b)+cos(c*i+d)+2); if(i>1) ans=max(ans,maxf-f); maxf=max(maxf,f); minf=min(minf,f); } if(ans<1e-6) printf("0\n"); else printf("%lf\n",ans); return 0;}
0 0
- World Finals 2015简要题解
- 2015 ACM-ICPC World Finals - Marrakech 题解(待续)
- ACM-ICPC 2013 World Finals 简单题解
- NOIP 2015 简要题解
- Noip 2015 senior ,The semi-finals,analysis (复赛题解)
- hdu 3847 2011world finals
- ACM-ICPC World Finals 2017
- [VK Cup 2015 - Round 1]简要题解
- 2013 ACM World Finals 中国代表队
- 周赛130715World Finals 2012 - Warsaw
- Puzzle, ACM/ICPC World Finals 1993, UVa227
- ACM/ICPC World Finals 2013 D Factors
- ACM/ICPC World Finals 2010 D Castles
- Puzzle,ACM/ICPC World Finals 1993,UVa227
- Gym 101205 (ACM-ICPC World Finals 2012)
- Puzzle,ACM/ICPC World Finals 1993, UVa227
- Sqaures, ACM/ICPC World Finals 1990, UVa
- Bubble Cup 9 - Finals [Online Mirror] 题解
- inode理解
- cmd cd 更改路径
- iOS开发多线程—02创建线程
- 宏的理解
- 遗传算法
- World Finals 2015简要题解
- STM32,无缝变频的关键
- 蒙蒙烟雨山城
- iOS开发多线程—03线程安全
- HDU ACM 4504 威威猫系列故事——篮球梦->DP
- Leetcode LRU Cache
- android parcelable 详解
- iOS开发多线程—04线程间的通信
- [数学]你的组合数学学得如何?