HGOI7 12集訓題解

2021-08-21 09:54:43 字數 2390 閱讀 2177

講真今天又是cf的題,而且還難得一匹…又和昨天一樣爆零orz。我就是cf的搬運工(今天還是沒有表情包orz)

【題目描述】

if(a[j][1]if(dp[l][r]a[j][1])+dfs(a[j][1],r))

}

#include 

#include

#include

#include

#include

using

namespace

std;

void fff()

const

int maxn=4110;

int m,n;

int h[maxn],a[maxn][2],id[maxn][maxn],dp[maxn][maxn],vis[maxn][maxn];

vector

g[maxn];

int dfs(int l,int r)}}

return dp[l][r]+=(id[l][r]?1:0);

}void output(int l,int r)else

}int main()

sort(h,h+m);

m=unique(h,h+m)-h;

for (int i=1;i<=n;i++)

memset(dp,-1,sizeof(dp));

printf("%d\n",dfs(1,m));

output(1,m);

}

【題目描述】

#include 

#include

#include

#include

#include

using namespace std;

typedef long long ll;

void fff()

const int maxn=211;

struct edge

} q[250];

vector edge;

ll n,m,tg,ts,s,fa[maxn];

ll find_(ll x)

int main());

}sort(edge.begin(),edge.end());

ll ans=0x7fffffffffffffff;

for (ll i=0,t=0;iq[++t]=e;

s=0;

for (ll j=t-1;j&& q[j+1].vs < q[j].vs;j--)

swap( q[j],q[j+1] );

for (ll j=1;j<=n;j++) fa[j]=j;

for (ll j=1,x,y;s

1&&j<=t;j++)

if(s==n-1) ans=min(ans,1ll*tg

*edge[i].vg+1ll*ts

*q[s].vs);

t=s;

}cout<<(ans==0x7fffffffffffffff? -1:ans);

return

0;}

【題目描述】

#include 

#include

#include

#include

using namespace std;

void fff()

const

int maxn=4000005;

const

int mod=51123987;

long

long n,l,a[maxn],f[maxn],g[maxn],mxr=0,p,sum=0;

char s[maxn];

int main()

s[l*2+1]='#';

s[l*2+2]='?';

n=l*2+1;

for (int i=1,q;i<=n;i++)

/////////

//////

/////// manacher

sum=sum*(sum-1)/2;

for (int i=2;i<=n;i+=2)

for (int i=1;i<=n;i+=2)

/////////

////差分

for (int i=2;i<=n;i+=2)

f[n+1]=0;

//////////遞推求取i之後開始的f[i]

for (int i=n-1;i>=1;i-=2)

for (int i=2;i<=n;i+=2)

cout<<(sum%mod+mod)%mod;

return

0;}

HGOI7 7集訓題解

今天這把題有點簡單,除了第二題數學方法沒想到之外,剩下的250草草收場。題目描述 include include include include include include include using namespace std void fff const int maxn 55 int be...

HGOI7 10集訓題解

今天開局狀態不行.noip2013day2的題.模擬賽輸入輸出打錯了 w w 在devc 下真的看不出來好嘛 然後果斷地爆了個零。題目描述 include include include include include using namespace std void fff const int m...

HGOI7 11集訓題解

首先宣告 由於今天一道題都沒有做出來 第一題只騙了30分 真的是題目太難 orz 所以以下的題目標程都是大佬提供的 題目描述 include include include include include define n 100100 using namespace std int n,k dou...