欢乐纪中某B组赛【2019.1.30】The penultimate day
生活随笔
收集整理的這篇文章主要介紹了
欢乐纪中某B组赛【2019.1.30】The penultimate day
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
前言
TodayisthepenultimatedayToday\ is\ the penultimate dayToday?is?thepenultimateday
成績
RankRankRank是有算別人的
| 333 | 2017zyc2017zyc2017zyc | 250250250 | 909090 | 100100100 | 606060 |
| 101010 | 2017xxy2017xxy2017xxy | 220220220 | 202020 | 100100100 | 100100100 |
| 212121 | 2017lrz2017lrz2017lrz | 180180180 | 202020 | 100100100 | 606060 |
| 212121 | 2017wyc2017wyc2017wyc | 180180180 | 303030 | 505050 | 100100100 |
| 545454 | 2017xjq2017xjq2017xjq | 110110110 | 000 | 505050 | 606060 |
| 727272 | 2017hzb2017hzb2017hzb | 808080 | 000 | 202020 | 606060 |
| 818181 | 2017lw2017lw2017lw | 707070 | 000 | 101010 | 606060 |
| 888888 | 2017hjq2017hjq2017hjq | 606060 | 000 | 000 | 606060 |
正題
T1:jzoj4252?T1:jzoj4252-T1:jzoj4252?QYQ的圖【dfsdfsdfs】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86702752
T2:jzoj4248?nT2:jzoj4248-nT2:jzoj4248?n染色【數(shù)學,快速冪】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86703758
T3:jzoj4249?T3:jzoj4249-T3:jzoj4249?游戲【貪心】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86703879
someofcodesome\ of\ codesome?of?code
T1 30分code
#include<cstdio> #include<algorithm> using namespace std; const int N=60; int tot,in[N],ans,w[N],flag[N],n,maxs,m; bool v[N],a[N][N],zh[N]; void dfs(int x) {in[++tot]=x;v[x]=1;ans+=w[x];for(int i=1;i<=n;i++)if(a[x][i]&&!v[i])dfs(i); } void get_ans(int dep,int z) {if(dep>tot){maxs=max(maxs,z);return;}get_ans(dep+1,z);if(!flag[dep]&&!zh[in[dep]]){for(int i=1;i<=tot;i++)if(a[in[dep]][in[i]])flag[i]++;get_ans(dep+1,z+w[in[dep]]);for(int i=1;i<=tot;i++)if(a[in[dep]][in[i]])flag[i]--;} } int main() {freopen("graph.in","r",stdin);freopen("graph.out","w",stdout);scanf("%d%d",&n,&m);for(int i=1;i<=n;i++)scanf("%d",&w[i]);for(int i=1;i<=m;i++){int x,y;scanf("%d%d",&x,&y);if(x==y) zh[x]=1;a[x][y]=a[y][x]=1;}for(int i=1;i<=n;i++){maxs=0;tot=0;dfs(i);get_ans(1,0);ans-=maxs;}printf("%d",ans); }T2 50分code
#include<cstdio> #define ll long long using namespace std; const ll XJQ=1e9+7; ll n,m,ans,f[100010][15]; int main() {freopen("color.in","r",stdin);freopen("color.out","w",stdout);scanf("%lld%lld",&n,&m);f[1][1]=1;for(ll i=2;i<=n+1;i++)for(ll j=1;j<=m;j++)for(ll k=1;k<=m;k++)if(k!=j)(f[i][j]+=f[i-1][k])%=XJQ;printf("%lld",f[n+1][1]*m%XJQ); }總結(jié)
爆炸了
T1不會,去寫T2,然后寫了個錯的。之后寫T3,開始寫dp,后來發(fā)現(xiàn)可以貪心,切掉。然后T1寫了個暴力(我還證明了暴力可過),結(jié)果寫掛了,炸掉30。然后T2找了半天規(guī)律,最后二分鐘開始寫,結(jié)果時間不夠,只有之前那個50分codeQVQ
尾聲
雷大爺險些Rank1Rank1Rank1
總結(jié)
以上是生活随笔為你收集整理的欢乐纪中某B组赛【2019.1.30】The penultimate day的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jzoj4249-游戏【贪心】
- 下一篇: 如何写网络小说电脑如何写小说