ssl提高组周三备考赛【2018.10.31】

版权声明:原创,未经作者允许禁止转载 https://blog.csdn.net/Mr_wuyongcong/article/details/83614567

前言

呆学校呆3天依旧不想复习期中,感觉要凉。


成绩

R a n k Rank P e r s o n Person S c o r e Score A A B B C C
1 1 2017 m y s e l f 2017myself 180 180 100 100 80 80 0 0
2 2 2014 y q f 2014yqf 140 140 0 0 40 40 100 100
4 4 2017 l w 2017lw 80 80 0 0 80 80 0 0
4 4 2017 h z b 2017hzb 80 80 0 0 80 80 0 0
4 4 2014 l x f 2014lxf 80 80 0 0 80 80 0 0
4 4 2017 l r z 2017lrz 80 80 0 0 80 80 0 0
7 7 2014 l y j 2014lyj 70 70 40 40 30 30 0 0
8 8 2014 l x 2014lx 60 60 0 0 60 60 0 0
9 9 2017 z y c 2017zyc 40 40 0 0 0 0 40 40
9 9 2015 g j h 2015gjh 40 40 0 0 0 0 40 40
9 9 2017 h j q 2017hjq 40 40 0 0 0 0 40 40

正题


T 1 : n s s l 1257 A T1:nssl1257-A 【数论】

博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83613856


T 2 : n s s l 1258 n a i v e T2:nssl1258-naive 的瓶子【贪心】

博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83614270


T 3 : n s s l 1259 s e q u e n c e T3:nssl1259-sequence 【组合数 , , 差分】

博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83614562


s o m e   o f   c o d e 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。

猜你喜欢

转载自blog.csdn.net/Mr_wuyongcong/article/details/83614567