ssl提高组周六备考赛【2018.10.20】
生活随笔
收集整理的這篇文章主要介紹了
ssl提高组周六备考赛【2018.10.20】
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言
er…竟然卡讀入輸出還不給快讀qwq
成績
有些dalao被老師拉去USACO了,所以沒有
HJW應該去jzoj做題了
| 111 | 2017myself2017myself2017myself | 240240240 | 707070 | 100100100 | 707070 |
| 222 | 2017zyc2017zyc2017zyc | 190190190 | 404040 | 100100100 | 505050 |
| 333 | 2017lrz2017lrz2017lrz | 190190190 | 606060 | 303030 | 100100100 |
| 444 | 2017xxy2017xxy2017xxy | 180180180 | 101010 | 100100100 | 707070 |
| 555 | 2017xjq2017xjq2017xjq | 140140140 | 101010 | 100100100 | 303030 |
| 666 | 2015zyf2015zyf2015zyf | 115115115 | 101010 | 555555 | 505050 |
| 777 | 2015yjy2015yjy2015yjy | 100100100 | 606060 | 000 | 404040 |
| 888 | 2017hjq2017hjq2017hjq | 959595 | 000 | 252525 | 707070 |
| 999 | 2017lw2017lw2017lw | 909090 | 000 | 808080 | 101010 |
| 101010 | 2017hzb2017hzb2017hzb | 909090 | 101010 | 303030 | 505050 |
正題
T1:nssl1209?T1:nssl1209-T1:nssl1209?奇怪的隊列【貪心,,,權值線段樹】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83213287
T2:nssl1210?T2:nssl1210-T2:nssl1210?質數【素數篩】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83213039
T3:nssl1211?T3:nssl1211-T3:nssl1211?好文章【字符串hash,maphash,maphash,map】
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/83213085
someofcodesome\ of\ codesome?of?code
T1 70分code
#include<cstdio> //#include<set> #include<algorithm> #define N 100010 using namespace std; struct node{int h,num,l,r; }a[N]; int n; bool cmp(node x,node y) {return x.h>y.h; } int main() {scanf("%d",&n);for(int i=1;i<=n;i++)scanf("%d%d",&a[i].h,&a[i].num);sort(a+1,a+1+n,cmp);for(int i=1;i<=n;i++)if(a[i].num>=i){printf("impossible");return 0;}a[0].r=n+1;a[n+1].l=0;//a[0].h=a[n+1].h=2147483647;for(int i=1;i<=n;i++){int now;if(a[i].num>=i/2){now=n+1;for(int j=1;j<=a[i].num;j++)now=a[now].l;}else{now=0;for(int j=0;j<=a[i].num;j++)now=a[now].r;}a[a[now].l].r=i;a[i].l=a[now].l;a[now].l=i;a[i].r=now;}int now=0;for(int i=1;i<=n;i++){now=a[now].r;printf("%d ",a[now].h);} }T3 70分code
#include<cstdio> #include<algorithm> #include<map> #define ull unsigned long long #define p 13331 #define p2 13127 #define N 200010 using namespace std; int n,m,ans; ull pow[N],h[N],h2[N],pow2[N]; char s[N]; map<pair<ull,ull>,bool> ok; ull ask(int l,int r) {return h[r]-h[l-1]*pow[r-l+1]; } ull ask2(int l,int r) {return h2[r]-h2[l-1]*pow2[r-l+1]; } int main() {scanf("%d%d",&n,&m);scanf("%s",s+1);pow[0]=pow2[0]=1;for(int i=1;i<=n;i++){pow[i]=pow[i-1]*p;pow2[i]=pow2[i-1]*p2;h[i]=h[i-1]*p+s[i]-'a'+1;h2[i]=h2[i-1]*p2+s[i]-'a'+1;}for(int i=m;i<=n;i++){ull k,k2;if(!ok[make_pair(k=ask(i-m+1,i),k2=ask2(i-m+1,i))]){ok[make_pair(k,k2)]=true;ans++;}}printf("%d",ans); }尾聲
沒了
總結
以上是生活随笔為你收集整理的ssl提高组周六备考赛【2018.10.20】的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 好的qq个性签名
- 下一篇: 电脑上网速度慢怎么办 碰到这样的情况可以