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是没看见要输出修改 ...
随机推荐
- LAN、WAN和WLAN的区别
1.LAN 局域网(Local Area Network)接口,通俗讲就是路由和用户之间网线口: 2.WAN 广域网(Wide Area Network),通俗讲就是和猫外部网连接的网线口: 3.WL ...
- 广度优先搜索BFS---求出矩阵中“块”的个数
题目: 给出一个 m x n 的矩阵,矩阵中的元素为0或1.如果矩阵中有若干个 1是相邻的,那么称这些1构成了一个“块”.求给定的矩阵中“块”的个数. 0 1 1 1 0 0 1 0 0 1 0 0 ...
- PMP--1. PMBOK框架部分目录
1.1 PMBOK体系框架描述https://www.cnblogs.com/hemukg/p/11821210.html 1.2 PMBOK指南组成部分https://www.cnblogs.com ...
- oracle 取某个时间的数据(每周几的上午几点到几点)
select count(*),t.分组字段 from (select t.* ,to_char(t.时间,'HH24') stime,to_char(t.时间,'HH24mi') fz,to_cha ...
- 洛谷P1218 [USACO1.5]特殊的质数肋骨 Superprime Rib 使用四种算法
洛谷P1218 [USACO1.5]特殊的质数肋骨 Superprime Rib 水题一道…… 题目描述 农民约翰的母牛总是产生最好的肋骨.你能通过农民约翰和美国农业部标记在每根肋骨上的数字认出它们. ...
- input清空和重置select下拉框
背景 一般页面搜索条件都会有input输入框和select选择框,同时页面上都会有重置reset按钮,这时就需要清空input和重置select 实现 清空input 清空单个input: $(&qu ...
- Vue项目中实现tab栏和步骤条的数据联动
也就是tab栏切换步骤条随之变化 <template> <div> <!-- 面包屑导航 --> <el-breadcrumb sepa ...
- SqlServer 常用语句方法
批量生成删表语句 select 'drop table '+b.name+'.'+a.name+';' from sys.tables a left join sys.schemas b on a.s ...
- shelll高级编程【实战】(1)
shell优势在于处理操作系统底层业务,2000多个命令都是shell的支持. 一键安装,报警脚本,常规业务操作,shell开发更简单快速. 1- 常用操作系统默认shell linux: Bourn ...
- 《The good doctor》视频笔记
第一季 第一弹可以看 角色 肖恩莫非 梅伦德斯 克莱尔·布朗 贾里德·卡鲁 道格拉斯院长 卡莉 青木 一个很厉害的女实习医生,忘记名字了 病理知识 自闭症:由于神经系统失调导致的发育障碍,其病征包括不 ...