版权声明:原创,未经作者允许禁止转载 https://blog.csdn.net/Mr_wuyongcong/article/details/83614567
前言
呆学校呆3天依旧不想复习期中,感觉要凉。
成绩
Rank |
Person |
Score |
A |
B |
C |
1 |
2017myself |
180 |
100 |
80 |
0 |
2 |
2014yqf |
140 |
0 |
40 |
100 |
4 |
2017lw |
80 |
0 |
80 |
0 |
4 |
2017hzb |
80 |
0 |
80 |
0 |
4 |
2014lxf |
80 |
0 |
80 |
0 |
4 |
2017lrz |
80 |
0 |
80 |
0 |
7 |
2014lyj |
70 |
40 |
30 |
0 |
8 |
2014lx |
60 |
0 |
60 |
0 |
9 |
2017zyc |
40 |
0 |
0 |
40 |
9 |
2015gjh |
40 |
0 |
0 |
40 |
9 |
2017hjq |
40 |
0 |
0 |
40 |
正题
T1:nssl1257−A【数论】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83613856
T2:nssl1258−naive的瓶子【贪心】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83614270
T3:nssl1259−sequence【组合数
,差分】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83614562
some of code
T2 80分code
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
ll t,n,a[310],ans,s;
int main()
{
scanf("%lld",&t);
for(ll i=1;i<=t;i++)
{
scanf("%lld",&n);
ans=1e18;
for(ll i=1;i<=n;i++)
scanf("%lld",&a[i]);
for(ll i=1;i<=n;i++)
{
s=0;
for(ll j=1;j<=n;j++)
if(a[j]!=a[i])
s+=a[j]*a[i];
ans=min(ans,s);
}
printf("%lld\n",ans);
}
}
尾声
题目依旧ABC。