前言
题目有毒系列。反正我觉得第1题最难,3,4题简单些。
跟jz大佬做题
成绩
RankRankRank是有算别人的
RankRankRank | PersonPersonPerson | ScoreScoreScore | AAA | BBB | CCC | DDD |
---|---|---|---|---|---|---|
111 | meselfmeselfmeself | 280280280 | 000 | 808080 | 100100100 | 100100100 |
121212 | xjqxjqxjq | 100100100 | 000 | 000 | 100100100 | 000 |
121212 | xxyxxyxxy | 100100100 | 000 | 000 | 100100100 | 000 |
121212 | zyczyczyc | 100100100 | 000 | 000 | 100100100 | 000 |
292929 | lrzlrzlrz | 303030 | 000 | 000 | 303030 | 000 |
292929 | hjqhjqhjq | 303030 | 000 | 000 | 303030 | 000 |
292929 | lwlwlw | 303030 | 000 | 000 | 303030 | 000 |
494949 | hzbhzbhzb | 000 | 000 | 000 | 000 | 000 |
正题
T1:jzoj5123−diyitiT1:jzoj5123-diyitiT1:jzoj5123−diyiti【统计,,,容斥】
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/84893821
T2:jzoj100042−T2:jzoj100042-T2:jzoj100042−保留道路【最小生成树,,,图论】
奇怪的题号
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/84892764
T3:jzoj3518−T3:jzoj3518-T3:jzoj3518−进化序列(evolve)(evolve)(evolve)【位运算】
位运算快乐题
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/84891935
T4:jzoj5223−BT4:jzoj5223-BT4:jzoj5223−B【矩阵乘法】
省选模拟赛?
博客链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/84891983
someofcodesome\ of\ codesome of code
T2 80分code
#include<cstdio>
#include<algorithm>
#define Inf 1e18
#define N 500
#define M 50010
#define ll long long
using namespace std;
struct node{ll x,y,g,s;
}a[M];
ll n,m,wS,wG,ans;
ll fa[N],s[M];
bool cmp(node x,node y)
{return x.g<y.g;}
ll find(ll x)
{return fa[x]==x?x:fa[x]=find(fa[x]);}
void unionn(ll x,ll y)
{ll Fa=find(x),Fb=find(y);if(Fa<Fb) fa[Fb]=Fa;else fa[Fa]=Fb;
}
ll check(ll ms)
{for(ll i=1;i<=n;i++)fa[i]=i;ll maxg=0,k=0;for(ll i=1;i<=m;i++){if(a[i].s>ms) continue;if(find(a[i].x)!=find(a[i].y)){maxg=max(maxg,a[i].g);k++;unionn(a[i].x,a[i].y);}if(k==n-1) break;}if(k<n-1) return Inf;return ms*wS+maxg*wG;
}
int main()
{scanf("%lld%lld%lld%lld",&n,&m,&wG,&wS);for(ll i=1;i<=m;i++){scanf("%lld%lld%lld%lld",&a[i].x,&a[i].y,&a[i].g,&a[i].s);s[i]=a[i].s;}ans=Inf;sort(s+1,s+1+m);sort(a+1,a+1+m,cmp);for(ll i=1;i<=m;i++){if(s[i]*wS>ans) break;ans=min(ans,check(s[i]));}if(ans==Inf) printf("-1");else printf("%lld",ans);
}
T1 0分code
#include<cstdio>
#include<algorithm>
#define N 35
#define A int(1e7)+10
using namespace std;
int n,v[A],a[N],ans;
int main()
{freopen("yist.in","r",stdin);freopen("yist.out","w",stdout);scanf("%d",&n);for(int i=1;i<=n;i++)scanf("%d",&a[i]),v[a[i]]++;sort(a+1,a+1+n);for(int i=4;i<=n;i++)for(int j=3;j<i;j++)for(int k=2;k<j;k++)for(int q=1;q<k;q++){if(a[i]+a[q]==a[j]+a[k]){int w=a[i]+a[q];if(v[w]>1)ans+=v[w]*(v[w]-1)/2;}}for(int i=3;i<=n;i++)for(int j=2;j<i;j++)for(int k=1;k<j;k++)ans+=(v[a[i]+a[j]+a[k]]>=3);printf("%d",ans);
}
尾声
又回jzoj做题了