当前位置:网站首页>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;
}
边栏推荐
- LeetCode 1984. Minimum difference in student scores
- Basic principles of video compression coding and audio compression coding
- (POJ - 3186) treatments for the cows (interval DP)
- < li> dot style list style type
- 解决Intel12代酷睿CPU单线程调度问题(二)
- Codeforces Round #801 (Div. 2)A~C
- Kubernetes cluster deployment
- 第五章 Yarn资源调度器
- Spark independent cluster dynamic online and offline worker node
- 解决Intel12代酷睿CPU单线程只给小核运行的问题
猜你喜欢
Advancedinstaller installation package custom action open file
FLV格式详解
One hundred questions of image processing (11-20)
It is forbidden to trigger onchange in antd upload beforeupload
Hbuilder X格式化快捷键设置
Chapter 6 rebalance details
原生js实现全选和反选的功能 --冯浩的博客
第一章 MapReduce概述
Kubernetes cluster deployment
Raspberry pie 4B installation opencv3.4.0
随机推荐
Solve the single thread scheduling problem of intel12 generation core CPU (II)
LeetCode1556. Thousand separated number
Calculate the time difference
Market trend report, technical innovation and market forecast of double-sided foam tape in China
Log statistics (double pointer)
LeetCode 1550. There are three consecutive arrays of odd numbers
Hbuilder X格式化快捷键设置
Chapter 2 shell operation of hfds
Local visualization tools are connected to redis of Alibaba cloud CentOS server
Cmake error: could not create named generator visual studio 16 2019 solution
Base dice (dynamic programming + matrix fast power)
Market trend report, technical innovation and market forecast of tabletop dishwashers in China
QT simulates mouse events and realizes clicking, double clicking, moving and dragging
Solve the problem that intel12 generation core CPU single thread only runs on small cores
Educational Codeforces Round 130 (Rated for Div. 2)A~C
ffmpeg命令行使用
Li Kou - 298th weekly match
Mp4 format details
(lightoj - 1369) answering queries (thinking)
MariaDB的安装与配置