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是没看见要输出修改 ...
随机推荐
- 【第二篇】xLua中lua加载方式
xLua中lua文件加载方式 1. 直接执行字符串方式 LuaEnv luaenv = new LuaEnv(); luaenv.DoString("CS.UnityEngine.Debu ...
- Python爬虫连载3-Post解析、Request类
一.访问网络的两种方法 1.get:利用参数给服务器传递信息:参数为dict,然后parse解码 2.post:一般向服务器传递参数使用:post是把信息自动加密处理:如果想要使用post信息,需要使 ...
- DoraBox sql注入&文件上传
SQL注入 1.sqli数字型 判断是否存在注入点,执行1 and 1=1,有回显判断存在注入点 判断字段数,执行1 order by 3以及执行1 order by 4时报错,判断字段数为3 判断具 ...
- c++多线程编程——初探
c++多线程并发可以帮助我们挖掘CPU的性能,在我们的思想中,似乎程序都是顺序执行的.这样的结论是建立在:程序是单线程程序.(比如我们平时写的hello world程序). 但是如果程序是多线程的.那 ...
- Winform中怎样对窗体进行隐藏,再次打开时仍然保留上次的窗体
场景 点击按钮后打开窗口,点击窗口的确定按钮后即使窗体返回了Ok,此时不关闭窗体,将窗体隐藏. 再次点击按钮后,仍然打开上次的窗体. 注: 博客主页: https://blog.csdn.net/ba ...
- TChart-数据编辑(TChartListBox,TeeCommander)
先上图 功能代码: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Contr ...
- Spring 理解和开始
1.先看看Spring的历史吧 https://baijiahao.baidu.com/s?id=1620099105315862154&wfr=spider&for=pc 2.Spr ...
- 项目部署 ubuntu Django uwsgi配置
1.进入项目文件夹 mkdir uwsgi_file vim uwsgi.ini 写入保存 [uwsgi] chdir = /home/mysite/my_project # 项目目录 module ...
- JAVA StringUtils工具类
org.apache.commons.lang Class StringUtils java.lang.Object org.apache.commons.lang.StringUtils publi ...
- 文件上传过waf的方法
原文链接: https://www.cesafe.com/8411.html 原始请求包: ——WebKitFormBoundary2smpsxFB3D0KbA7D Content-Dispositi ...