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是没看见要输出修改 ...
随机推荐
- elementui_day02
Elementui_day02 1. maven多模块搭建 1.1 搭建多模块的好处 1. 方便维护(代码增加,拆分越细,越好维护) 2. 有些公共的内容(BaseDomain.BaseService ...
- php趣题小记
题目一: $a = 'abc'; $a++; echo $a; // abd 题目二: function myfun($a){ echo $a+10; } $a = 10; echo "my ...
- Android实战项目:房贷计算器
APP源码已上传到我的GitHub:https://github.com/zdm-code/Android-learning/tree/master/android_learning/mortgage ...
- centos系统mongodb安装
使用腾讯云搭服务器时,需要链接数据库,就从头开始重新安装了一遍mongodb,没想到这么麻烦,记得之前没这么麻烦. 1.下载mongodb(一篇博客的) 安装的是3.6版本 `` vim /etc/y ...
- 如果在vscode 中用运行快捷键(Ctrl+Alt+N)出现中文的乱码
在VSCODE中,运行代码的快捷方式是Ctrl+Alt+N,终止 代码运行的方式是Ctrl+Alt+M,但是有时候会出现汉字的乱码,这种情况并不是代码有问题,只要在terminal 中运行代码就可以了 ...
- Parity game POJ - 1733 带权并查集
#include<iostream> #include<algorithm> #include<cstdio> using namespace std; <& ...
- 代数式转换为c语言表达式(很简单)
- xampp安装配置比较容易卡住的地方
xampp作为一款集成建站软件,方便了不少初学的开发者,但是虽然是集成和傻瓜式的安装,还是会遇到一些容易卡壳的地方,这里记录自己觉得一些比较重要的东西. 1.端口问题 如图是我改之后的端口,原来端口为 ...
- ES6实现图片切换特效
效果图 demo.html <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...
- vue踩坑:vue+ element ui 表单验证有值但验证失败。
一.如图:有值但是验证失败 二. <el-form :model="form" :rules="rules"> <el-form-item l ...