当前位置:网站首页>7-6 sum of combinatorial numbers
7-6 sum of combinatorial numbers
2022-07-06 16:43:00 【HBUcs2020】
The problem is very simple , But found a different solution
/ Enter each number in turn , The number of times each number appears in tens and tens is n-1
#include<iostream>
using namespace std;
int main()
{
int n,sum=0;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
// Enter each number in turn , The number of times each number appears in tens and tens is n-1
sum+=a[i]*11*(n-1);
}
// for(int i=0;i<n;i++)
// {
// for(int j=0;j<n;j++)
// {
// if(i!=j)
// sum+=a[i]*10+a[j];
// }
// }
cout<<sum<<endl;;
return 0;
}边栏推荐
- It is forbidden to trigger onchange in antd upload beforeupload
- Basic principles of video compression coding and audio compression coding
- 第5章 NameNode和SecondaryNameNode
- 软通乐学-js求字符串中字符串当中那个字符出现的次数多 -冯浩的博客
- Problem - 1646C. Factorials and Powers of Two - Codeforces
- Problem - 922D、Robot Vacuum Cleaner - Codeforces
- (POJ - 1458) common subsequence (longest common subsequence)
- Chapter III principles of MapReduce framework
- The concept of spark independent cluster worker and executor
- 力扣leetcode第 280 场周赛
猜你喜欢

Cmake Express

Discussion on QWidget code setting style sheet

LeetCode 1557. The minimum number of points that can reach all points

CMake速成

视频压缩编码和音频压缩编码基本原理

Click QT button to switch qlineedit focus (including code)

第5章 NameNode和SecondaryNameNode

使用jq实现全选 反选 和全不选-冯浩的博客

Chapter 5 namenode and secondarynamenode

Ffmpeg command line use
随机推荐
Educational Codeforces Round 130 (Rated for Div. 2)A~C
第5章 消费者组详解
Raspberry pie 4B installation opencv3.4.0
业务系统从Oracle迁移到openGauss数据库的简单记录
QT realizes window topping, topping state switching, and multi window topping priority relationship
Acwing: the 56th weekly match
Click QT button to switch qlineedit focus (including code)
第5章 NameNode和SecondaryNameNode
第五章 Yarn资源调度器
Codeforces Round #800 (Div. 2)AC
Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it
<li>圆点样式 list-style-type
FLV格式详解
CMake Error: Could not create named generator Visual Studio 16 2019解决方法
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
Cmake error: could not create named generator visual studio 16 2019 solution
Investigation report of bench type Brinell hardness tester industry - market status analysis and development prospect prediction
原生js实现全选和反选的功能 --冯浩的博客
Spark's RDD (elastic distributed data set) returns a large result set
Summary of game theory