CodeForces -1216B.Shooting
水题
#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的更多相关文章
- CodeForces 30C Shooting Gallery 简单dp
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/qq574857122/article/details/36944227 题目链接:点击打开链接 给定 ...
- Codeforces Round #587 (Div. 3) B. Shooting(贪心)
链接: https://codeforces.com/contest/1216/problem/B 题意: Recently Vasya decided to improve his pistol s ...
- 【20.00%】【codeforces 44G】Shooting Gallery
time limit per test5 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- Codeforces Gym 100803D Space Golf 物理题
Space Golf 题目连接: http://codeforces.com/gym/100803/attachments Description You surely have never hear ...
- 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 ...
- CodeForces 312B Archer
Archer Time Limit: 2000ms Memory Limit: 262144KB This problem will be judged on CodeForces. Original ...
- Codeforces Round 363 Div. 1 (A,B,C,D,E,F)
Codeforces Round 363 Div. 1 题目链接:## 点击打开链接 A. Vacations (1s, 256MB) 题目大意:给定连续 \(n\) 天,每天为如下四种状态之一: 不 ...
- 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 ...
- Codeforces Round #587 (Div. 3)
https://codeforces.com/contest/1216/problem/A A. Prefixes 题意大概就是每个偶数位置前面的ab数目要相等,很水,被自己坑了 1是没看见要输出修改 ...
随机推荐
- LAMP搭建随笔
前言 这是我第一次在写博客,里面记录了我配置LAMP遇到的各种各样的细节,也许表述不够准确,希望大佬给于批评指正 环境 OS Ubuntu server 18.04.3 远程连接软件 cmder 文件 ...
- requests库爬取需要登录的网站
#!usr/bin/env python #-*- coding:utf-8 _*- """ @author:lenovo @file: 登录人人网.py @time: ...
- Page Visibility API
在code review时看见同事使用visibilitychange 事件来监听页面的隐藏与显示,之前没有了解过这块,学习一下. document.visibilityState 主要有以下3个状态 ...
- 铭飞MCMS将4.6模板标签升级至4.7
个人博客 地址:https://www.wenhaofan.com/article/20190610145529 介绍 MCMS提供的模板大多数都使用的是4.6版本的标签,但是现在MCMS最新的已经是 ...
- H5_0023:html页面禁止放大缩小页面
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scal ...
- P1341 当然是选择AC它了!(字符串处理)
A. 当然是选择AC它了! 题目描述 听闻第八届程序设计大赛马上就要开始了,已经报名的童鞋们都纷纷去 OJ 刷题.但你的女朋友 (tan90°) 想知道她写的 "A + B 问题" ...
- 必看!macOS进阶不得不知的实用小技巧
不知道大家对使用苹果电脑的体验如何?您充分利用您的mac了吗?其实macOS上存在着许多快捷方式和技巧可以帮助简化我们的工作流程,提高效率,但是在日常生活中经常被人们忽略或者遗忘.以下是macdown ...
- 为什么文件无法用wps打开,甚至wps.exe本身都无法打开?
原因: 我的wps.exe在目录 programme installation 中 如果我把目录改成 programmeInstallation 那么就会变成打不开的情况. 解决方法就是改回去. 怎么 ...
- Java_Day6(上)
Java learning_Day6 本人学习视频用的是马士兵的,也在这里献上 <链接:https://pan.baidu.com/s/1qKNGJNh0GgvlJnitTJGqgA> 提 ...
- Tomcat 后台war部署上传shell
tomcat的后台登录的两个目录为: /admin /manager/html 如果版本过高,只有采用弱密码的方式进后台: 有些tomcat采用默认的用户名和密码(用户名:admin,密码:空): 或 ...