水题

#include <cstdio>
#include <algorithm>
using namespace std;
const int N = ;
struct node{
int s, f;
inline bool operator < (const node &o) const{
return s < o.s;
}
} a[N];
int main() {
int n;
scanf("%d", &n);
for (int i = ; i < n; i++) {
scanf("%d", &a[i].s);
a[i].f = i + ;
}
sort(a, a + n);
int sum = ;
for (int i = ; i < n; i++)
sum += i * a[n - - i].s + ;
printf("%d\n", sum);
for (int i = n - ; i >= ; i--)
printf("%d ", a[i].f);
return ;
}

CodeForces -1216B.Shooting的更多相关文章

  1. CodeForces 30C Shooting Gallery 简单dp

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/qq574857122/article/details/36944227 题目链接:点击打开链接 给定 ...

  2. Codeforces Round #587 (Div. 3) B. Shooting(贪心)

    链接: https://codeforces.com/contest/1216/problem/B 题意: Recently Vasya decided to improve his pistol s ...

  3. 【20.00%】【codeforces 44G】Shooting Gallery

    time limit per test5 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...

  4. Codeforces Gym 100803D Space Golf 物理题

    Space Golf 题目连接: http://codeforces.com/gym/100803/attachments Description You surely have never hear ...

  5. Codeforces Round #185 (Div. 2) B. Archer 水题

    B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B D ...

  6. CodeForces 312B Archer

    Archer Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ...

  7. Codeforces Round 363 Div. 1 (A,B,C,D,E,F)

    Codeforces Round 363 Div. 1 题目链接:## 点击打开链接 A. Vacations (1s, 256MB) 题目大意:给定连续 \(n\) 天,每天为如下四种状态之一: 不 ...

  8. Educational Codeforces Round 40 G. Castle Defense (二分+滑动数组+greedy)

    G. Castle Defense time limit per test 1.5 seconds memory limit per test 256 megabytes input standard ...

  9. Codeforces Round #587 (Div. 3)

    https://codeforces.com/contest/1216/problem/A A. Prefixes 题意大概就是每个偶数位置前面的ab数目要相等,很水,被自己坑了 1是没看见要输出修改 ...

随机推荐

  1. c#XML的基本使用

    创建XML文档 static void Main(string[] args) { //1.引入命名空间 //2.创建XML文档对象 XmlDocument xmldoc = new XmlDocum ...

  2. UVA-1588

    只用C来写 题目:https://vjudge.net/problem/UVA-1588 #include<stdio.h> #include<string.h> #defin ...

  3. LeetCode 145. 二叉树的后序遍历 (用栈实现后序遍历二叉树的非递归算法)

    题目链接:https://leetcode-cn.com/problems/binary-tree-postorder-traversal/ 给定一个二叉树,返回它的 后序 遍历. 示例: 输入: [ ...

  4. 论文阅读笔记(二十二)【CVPR2017】:See the Forest for the Trees: Joint Spatial and Temporal Recurrent Neural Networks for Video-based Person Re-identification

    Introduction 在视频序列中,有些帧由于被严重遮挡,需要被尽可能的“忽略”掉,因此本文提出了时间注意力模型(temporal attention model,TAM),注重于更有相关性的帧. ...

  5. ArcGIS JavaScript API with jQuery: Error: multipleDefine

    I would like to use ArcGIS JavaScript API 4.3 with jQuery, but I am getting following errors.  I sea ...

  6. 使用 VMware Workstation Pro 安装新的虚拟机

     一.连接服务器 (1)“文件”右键 (2)输入用户名.密码连接服务器 二.创建新的虚拟机 (1) (2) (3) (4) (5) (6) (7) (8)  三.配置服务器 配置文档 - 链接:htt ...

  7. vsftp配置遇到的一些问题

    设置匿名登陆的时候,要保证 /var/ftp/ 的所有者 是root,不然会一直提示输入用户名和密码,无法登陆! 上传的权限 local_umask =002 以及 匿名用户 anon_umask=0 ...

  8. java文本文件加密

    加密方法是通过输入流对源文件字符逐个读取,对其读取到字符的ascll值进行异或运算,并将其放入新文件中,解密时只要用相同的密钥进行ascll异或运算并向新文件输出即可,即对文件首次用该程序处理为加密, ...

  9. thinkphp5.0将数据指模板中

    在控制器中写: public function index(){ $username = \think\Db::table('navigation')->where(array("Vi ...

  10. A Bug's Life____并查集

    English preparation: falsify     伪造:篡改:歪曲:证明...虚假 the sexual behavior of a rare species of bugs. 一种稀 ...