#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
using namespace std;
/*
对于第i个数字(i=0~n-1),它每组出现的次数为n-i,出现在前i+1个组中
*/
const int maxn=+;
double num[maxn];
int main()
{
int n;
scanf("%d",&n);
double sum=0.0f;
for(int i=;i<n;i++){
scanf("%lf",&num[i]);
sum+=num[i]*(n-i)*(i+);
}
printf("%.2lf",sum);
return ;
}

PAT甲题题解-1104. Sum of Number Segments (20)-(水题)的更多相关文章

  1. PAT (Advanced Level) 1104. Sum of Number Segments (20)

    简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...

  2. PAT 甲级 1104. Sum of Number Segments (20) 【数学】

    题目链接 https://www.patest.cn/contests/pat-a-practise/1104 思路 最容易想到的一个思路就是 遍历一下所有组合 加一遍 但 时间复杂度 太大 会超时 ...

  3. 【PAT甲级】1104 Sum of Number Segments (20 分)

    题意:输入一个正整数N(<=1e5),接着输入N个小于等于1.0的正数,输出N个数中所有序列的和. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC ...

  4. PAT 甲级 1104 sum of Number Segments

    1104. Sum of Number Segments (20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, Pen ...

  5. PAT甲级——1104 Sum of Number Segments (数学规律、自动转型)

    本文同步发布在CSDN:https://blog.csdn.net/weixin_44385565/article/details/90486252 1104 Sum of Number Segmen ...

  6. PAT甲题题解-1012. The Best Rank (25)-排序水题

    排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询 ...

  7. PAT甲题题解-1058. A+B in Hogwarts (20)-大水题

    无语,这种水题还出,浪费时间,但又不得不A... #include <iostream> #include <cstdio> #include <algorithm> ...

  8. PAT甲题题解-1062. Talent and Virtue (25)-排序水题

    水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include < ...

  9. PAT 1104 Sum of Number Segments

    Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For exam ...

随机推荐

  1. JVM打印加载类的详情信息

    使用JVM参数即可:-XX:+TraceClassLoading

  2. 错误 ORA-01102: cannot mount database in EXCLUSIVE mode 的处理方法

    今天启动数据库时报错了! SQL> startup mount ORACLE instance started. Total System Global Area  608174080 byte ...

  3. Oracle RMAN 恢复数据库到不同主机(一)

    一.RMAN 备份的内容 RMAN做数据库全备时包含了 数据文件.归档日志.控制文件和参数文件和备份日志,如下: arch_20160223_08qukp2t_1_1  arch_20160223_0 ...

  4. pyspider爬取数据存入es--1.安装驱动

    跟使用mysql一样,不安装es驱动的话,也会触发模块找不到的错误 ImportError: No module named elasticsearch 通过pip安装 pip install ela ...

  5. WorldWind源码剖析系列:图层管理器按钮类LayerManagerButton和菜单条类MenuBar

    WorldWindow用户定制控件类中所包含的的可视化子控件主要有:图层管理器按钮类LayerManagerButton和菜单条类MenuBar.BmngLoader类中所包含的的可视化子控件主要有: ...

  6. leetcode338—Counting Bits

    Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the ...

  7. WebView之禁止调用第三方浏览器

    一.WebView官方简洁: 一个显示视图的web页面.在这个类的基础上你可以滚自己的web浏览器或简单地显示一些网上的内容.它使用WebKit渲染引擎显示web页面,包括方法向前和向后导航历史,放大 ...

  8. 秋风下的萧瑟 NOIP2018 游记

    “北方的秋天还真的是美丽冻人呢!” 是么?我有些疑惑,任凭雨滴落在脸上. 这天,可真不好,秋雨可让这天气一天比一天的寒冷了. 大概,故事从这里开始吧? 上一次的故事说道了哪里?那么,我们从今天的新故事 ...

  9. MySQL学习笔记04 插入中文时出现ERROR 1366 (HY000)

    1 环境: MySQL Server 6.0  命令行工具 2 问题 :  插入中文字符数据出现如下错误: ERROR 1366 (HY000): Incorrect string value: '\ ...

  10. Javascript 地图库收集

    ArcGis leafletjs openlayers jvectormap