ssl提高组周三备考赛【2018.10.24】
生活随笔
收集整理的這篇文章主要介紹了
ssl提高组周三备考赛【2018.10.24】
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
前言
快樂題警告!
成績
| 111 | 2017myself2017myself2017myself | 210210210 | 100100100 | 100100100 | 101010 |
| 222 | 2017zyc2017zyc2017zyc | 158158158 | 100100100 | 181818 | 404040 |
| 333 | 2017xxy2017xxy2017xxy | 157157157 | 100100100 | 272727 | 303030 |
| 444 | 2017hzb2017hzb2017hzb | 148148148 | 100100100 | 181818 | 303030 |
| 555 | 2017lrz2017lrz2017lrz | 145145145 | 100100100 | 454545 | 000 |
| 666 | 2017xjq2017xjq2017xjq | 140140140 | 100100100 | 000 | 404040 |
| 777 | 2017lw2017lw2017lw | 109109109 | 100100100 | 999 | 000 |
| 888 | 2016whf(過來水分的dalao)2016whf(過來水分的dalao)2016whf(過來水分的dalao) | 100100100 | 000 | 100100100 | 000 |
| 999 | 2017hjq2017hjq2017hjq | 100100100 | 100100100 | 000 | 000 |
| 101010 | 2015gjh2015gjh2015gjh | 100100100 | 100100100 | 000 | 000 |
| 101010 | 2015zyf2015zyf2015zyf | 100100100 | 100100100 | 000 | 000 |
正題
T1:nssl1216?T1:nssl1216-T1:nssl1216?碼靈鼠【數(shù)學(xué)】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83419492
T2:nssl1217?Somanyprefix?T2:nssl1217-So many prefix?T2:nssl1217?Somanyprefix?【KMPKMPKMP】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83419538
T3:nssl1218?TRAVELT3:nssl1218-TRAVELT3:nssl1218?TRAVEL【SPFASPFASPFA】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83419602
someofcodesome\ of\ codesome?of?code
T3 10分code
#include<cstdio> #include<queue> #include<cstring> #include<algorithm> #define N 1010 using namespace std; struct node{int to,l,r,next; }a[N*10]; int n,m,L,R,f[N],ls[N],tot,cnt,lh[N*10]; bool v[N]; queue<int> q; int read(){int x=0,flag=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')flag=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*flag; } void write(int x) {if(x>9) write(x/10);putchar(x%10+48);return; } void addl() {int x,y,l,r;x=read();y=read();l=read();r=read();a[++tot]=(node){y,l,r,ls[x]};ls[x]=tot;a[++tot]=(node){x,l,r,ls[y]};ls[y]=tot; } int spfa(int L) {memset(f,0,sizeof(f));q.push(1);f[1]=2147483647/3;v[1]=true;while(!q.empty()){int x=q.front();q.pop();for(int i=ls[x];i;i=a[i].next){int y=a[i].to;if(a[i].l<=L&&a[i].r>f[y]){f[y]=a[i].r;if(!v[y]){v[y]=true;q.push(y);}}}v[x]=false;}return f[n]; } int main() {scanf("%d%d",&n,&m);for(int i=1;i<=m;i++){addl();lh[++cnt]=a[tot].l;}sort(lh+1,lh+1+n);cnt=unique(lh+1,lh+1+n)-lh-1;for(int k=1;k<=cnt;k++){int i=lh[k];int r=spfa(i);if(r-i+1>R-L+1){L=i;R=r;}}write(R-L+1);putchar('\n');if(R-L+1)for(int i=L;i<=R;i++)write(i),putchar(' '); }尾聲
然而我第3題想法是對的…
總結(jié)
以上是生活随笔為你收集整理的ssl提高组周三备考赛【2018.10.24】的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 分字的多音字组什么词语 分字的多音字组词
- 下一篇: P2522-[HAOI2011]Prob