1466. Taunt Exposure Estimation

Constraints

Time Limit: 5 secs, Memory Limit: 32 MB

Description

The brave knights (kə’ nig’ əts) of Camelot are constantly exposed to French taunting while assaulting the castle occupied by the French.  Consequently, the taunting to which they are exposed varies with their distance from the castle during their assault, as well as variations in French taunting activity.  We need to estimate the total amount of taunting that they are exposed to during a certain time period.  Unfortunately, we only have access to a set of measurements at random times — we do not have a continuous reading — and, because of flaws in our archaic equipment, the measurements of taunting occur at unpredictable intervals.
The total amount of taunting will be given by the integral of the taunting intensity during the time period, as held in the observation data file.  The amount of random noise, though, is fairly high, so that a simple trapezoid-rule integration is all that is merited.

Input

· A single number, n, specifying the number of data points in the file
· n pairs of floating point numbers (given in increasing x order), separated by a comma — in other words, a CSV file that could be input for a spreadsheet program [the first number is the x coordinate (time specification), the second is the y coordinate (the radiation reading)]

Output

A single line of text giving the first and last x values (with two digits to the right of the decimal point), and the computed integral (with four digits to the right of the decimal point), in the fashion shown below (which reflects the data shown in the graph):
0.00 to 365.25: 2099.8021

Sample Input

90.0000, 0.51760.9869,  1.0001.596,  1.1142.370,  1.0062.904, 0.84813.506, 0.57603.996, 0.47755.004, 0.39456.283,  1.004

Sample Output

0.00 to 6.28: 4.7288

// Problem#: 1466
// Submission#: 3316720
// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/
// All Copyright reserved by Informatic Lab of Sun Yat-sen University
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <string>
#include <queue>
#include <set>
#include <iomanip>
#include <map>
using namespace std;const int MAX_N = 10000;int main() {//std::cout.sync_with_stdio(false);int n;scanf("%d", &n);double xy[MAX_N][2];char temp;for (int i = 0; i < n; i++) {scanf("%lf%c%lf", &xy[i][0], &temp, &xy[i][1]);}double ans = 0;for (int i = 1; i < n; i++) ans += (xy[i][1] + xy[i - 1][1]) * (xy[i][0] - xy[i - 1][0]) / 2;printf("%.2lf to %.2lf: %.4lf\n", xy[0][0], xy[n - 1][0], ans);return 0;
}                                 

Sicily 1466. Taunt Exposure Estimation相关推荐

  1. HDU 3132 Taunt Exposure Estimation(数学)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3132 Problem Description The brave knights  of Camelo ...

  2. Dual Illumination Estimation for Robust Exposure Correction阅读札记

    Dual Illumination Estimation for Robust Exposure Correction 阅读札记   论文发表于2019年的CGF. Abstract   本文方法主要 ...

  3. 基于双光照估计的曝光校正: Dual Illumination Estimation for Robust Exposure Correction

    Dual Illumination Estimation for Robust Exposure Correction [pdf] 目录 Abstract 1. Introduction 3. Our ...

  4. Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement

    Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement 论文链接:https://arxiv.org/abs/2001 ...

  5. 曝光修正相关工作:Related Work on the Exposure Correction

    本博客对曝光校准的相关工作进行简单总结,内容选自 2021 CVPR 文章:Learning Multi-Scale Photo Exposure Correction. 博客:https://blo ...

  6. 光流 Motion Estimation

    Introduction to Motion Estimation with Optical Flow   博客文章质量很高啊 Lucas-Kanade Optical Flow [算法分析]Luca ...

  7. 物体6-Dof pose estimation主流方法汇总

    作者丨孙文@知乎 来源丨https://www.zhihu.com/question/63159179/answer/257832184 编辑丨3D视觉工坊 主流的方法有下面几种: 基于模板匹配的方法 ...

  8. 介绍一篇通过无监督depth estimation改进语义分割的论文

    点击上方"3D视觉工坊",选择"星标" 干货第一时间送达 作者丨黄浴@知乎 来源丨https://zhuanlan.zhihu.com/p/341180239 ...

  9. 图像拼接--Coarse-to-fine Seam Estimation for Image Stitching

    Coarse-to-fine Seam Estimation for Image Stitching https://arxiv.org/abs/1805.09578 本文主要针对图像拼接中的缝合线选 ...

最新文章

  1. 使用程序解决一道逻辑推理题
  2. 实验研究信标无线电能输出功率的因素
  3. 【Java并发编程】并发容器之CopyOnWriteArrayList
  4. 安装node-sass时出现的错误解决方案(Mac自用,也可以借鉴)
  5. Web Service 概念
  6. lucene倒排索引瘦身的一些实验——merge的本质是减少cfx文件 变为pos和doc;存储term vector多了tvx和tvd文件有337M...
  7. 用matlab绘制抛物线y的x平方,我刚刚学习MATLAB,想画一下(x^2+y^2-1)^3=x^2*y^3这个曲线的图像,该怎么画呢,谢谢大家了。...
  8. Android 自定义WebView弹窗及屏蔽弹窗
  9. nginx 反向代理 502 错误的解决
  10. linux重启用reboot后起不来_linux使用reboot重启后怎么办?
  11. 那些年,我们解析过的前端异常
  12. Ubuntu21.04安装网易有道词典
  13. ryzen linux 搭配显卡,R5 1500X配什么显卡好 适合AMD锐龙5 1500X搭配的显卡推荐
  14. 摄氏度和开氏度的换算_摄氏度,开氏度,华氏度等常见温度单位转换在线计算器_三贝计算网_23bei.com...
  15. 永中office linux卸载,永中Office Linux版官方下载_永中Office Linux版下载8.0.1331 - 系统之家...
  16. 在电脑上修改apk、重新签名apk
  17. Android系统中的输入输出设备
  18. Ugurgallen只是使用ps的简单拼贴技术,却刺痛42万人的心!
  19. Linux下aMule安装教程
  20. unixtime时间转换mysql_MySQL中from_unixtime()时间转换

热门文章

  1. ThingsBoard架构简介
  2. 2021美赛D题思路
  3. 软通纽约_纽约地铁数学
  4. C++程序设计语言导论
  5. 富文本编辑器CKEditor 5的使用
  6. 上海航芯| BMS专题之BMS基础功能模块概述分享
  7. 论文勘误 (Paper erratum)
  8. Chapter 1.伦敦的歌剧魅影 ——《地与光》
  9. 语音增强--维纳滤波介绍及MATLAB实现
  10. 全链路稳定性背后的数字化支撑:阿里巴巴鹰眼技术解密