水题

#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. VSCode(主进程)

    Overview(总览) SETUP(设定) Overview(总览) Linux(略) macOS(略) Windows 使用WSL,您可以在Windows上安装和运行Linux发行版.这使您能够在 ...

  2. Vulnerable Kerbals CodeForces - 772C【拓展欧几里得建图+DAG上求最长路】

    根据拓展欧几里得对于同余方程 $ax+by=c$ ,有解的条件是 $(a,b)|c$. 那么对于构造的序列的数,前一个数 $a$  和后一个数 $b$ ,应该满足 $a*x=b(mod m)$ 即 $ ...

  3. php ftp 使用 以及 php_connect_nonb() failed: Operation now in progress (115)

    设置 ftp_pasv($conn,true);  会出现下面错误   不设置 调用ftp 连接没问题  ftp_nlist  ftp_put ftp_get 等函数都不成功 ftp_nb_fput( ...

  4. 获取http://XX.XX.XX.XX :XXXX/QuestionResult.aspx?method=接口返回值

    private string GetWeather(string strRegisterNo) { string getWeatherUrl = "http://XX.XX.XX.XX :X ...

  5. Android数据存储之SD卡文件操作

    赶上智能手机刚问世时有幸用过的小伙伴都知道,那时候的Android系统是把我们自己买的SD卡作为外部存储的,但是不知道从哪天开始,SD卡就被固化到智能手机的内部了,但是我们仍然把它称为外部存储.我想A ...

  6. JS: javascript 点击事件执行两次js问题 ,解决jquery绑定click事件出现点击一次执行两次问题

    javascript 点击事件执行两次js问题 在JQuery中存在unbind()方法,先解绑再添加点击事件,解决方案为: $(".m-layout-setting").unbi ...

  7. 剑指offer-面试题14-剪绳子-动态规划法

    /* 题目: 给定一个长度为n的绳子,把绳子剪为m段,(n>1,m>1) 求各段绳子乘积的最大值. */ /* 思路: 动态规划. f(n)=max(f(1)*f(n-1),f(2)*f( ...

  8. exiftool生成XMP文件方法

    ExifTool是一个独立于平台的Perl库,另外还有一个命令行应用程序,用于读取,编写和编辑各种文件中的元信息.ExifTool支持许多不同的元数据格式,包括EXIF,Gps,IPTC,XMP,JF ...

  9. 曼孚科技:AI算法领域常用的39个术语(下)

    算法是人工智能(AI)核心领域之一. 本文整理了算法领域常用的39个术语,希望可以帮助大家更好地理解这门学科. 本文为下半部分,上半部分见本账号上一篇文章. 19.迁移学习(Transfer Lear ...

  10. Tomcat 后台war部署上传shell

    tomcat的后台登录的两个目录为: /admin /manager/html 如果版本过高,只有采用弱密码的方式进后台: 有些tomcat采用默认的用户名和密码(用户名:admin,密码:空): 或 ...