平板游戏

news/2024/11/15 0:04:25/

http://47.96.116.66/problem.php?cid=1177&pid=0

http://47.96.116.66/problem.php?cid=1180&pid=0

题解:先合并最大的。

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,q;
int ans,cnt,flag,temp,sum;
int a[N];
char str;
struct node{};
int main()
{
#ifdef DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout);
#endif//ios::sync_with_stdio(false);//cin.tie(0);//cout.tie(0);//scanf("%d",&t);//while(t--){scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d",&a[i]);}sort(a+1,a+n+1);for(int i=2;i<=n;i++){ans+=a[i-1]*a[i];a[i]=a[i-1]+a[i];}cout<<ans<<endl;//}#ifdef DEBUGprintf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif//cout << "Hello world!" << endl;return 0;
}

 


http://www.ppmy.cn/news/177268.html

相关文章

amoeba启动报错The stack size specified is too small, Specify at least 228k

Amoeba启动错误&#xff1a; #amoeba start The stack size specified is too small, Specify at least 228k Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 解决方法&#xff1a; 打开bin目录下 的amoeb…

windows杀掉8080端口进程

一、关闭进程 1.1 执行一下命令 查询端口PID netstat -ano | findstr 8080 杀掉该PID taskkill -f /pid 7728 执行效果如下

Specified value of sga_target xxxM is too small, needs to be at least xxxM

日萌社 人工智能AI&#xff1a;Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战&#xff08;不定时更新&#xff09; Specified value of sga_target xxxM is too small, needs to be at least xxxM 解决&#xff1a;服务器的内存或者虚拟机分配给linux的内存不足&…

[1]# hdu 2096

hdu 2096 直接模拟即可 #include<cstdio> int main() {int t;while(~scanf("%d",&t))while(t--){int a, b;scanf("%d%d",&a,&b);a a < 100? a: (a%100);b b < 100? b: (b%100);int sum (ab) < 100? (ab): (ab)…

爱普生WF7710WF7720WF3720 升级固件导致墨盒不识别解决方法

爱普生WF7710 wf7720 3720不小心点了固件升级了,不认墨盒,用不了了。![在这里插入图片描述](https://img-blog.csdnimg.cn/20191225114059610.png?x-oss-processimage/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1FMZGF5aW5qaQ,size_16…

JSP+ssm计算机毕业设计儿童成长信息管理系统t7728【源码、数据库、LW、部署】

项目运行 项目含有源码、文档、程序、数据库、配套开发软件、软件安装教程 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xf…

hive执行count(*):Stage-1 map = 0%, reduce = 0%

1、问题描述&#xff1a; 在hive的shell端执行&#xff1a;select count(*) from student;出现了下面问题&#xff08;一直卡着&#xff09;&#xff1a; hive> select count(*) from student; WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in …

keil MDK编译完成后,Program Size: Code,RO-data,RW-data,ZI-data的意义

keil MDK编译完成后&#xff0c;Program Size: Code&#xff0c;RO-data&#xff0c;RW-data&#xff0c;ZI-data的意义 转载 2016-02-12 15:27:07 Program Size: Code344 RO-data252 RW-data100 ZI-data1024 看了多遍&#xff0c;总是忘&#xff0c;这次还是把它分析透了…