前言
er…竟然卡读入输出还不给快读qwq
成绩
有些dalao被老师拉去USACO了,所以没有
HJW应该去jzoj做题了
RankRankRank | PersonPersonPerson | ScoreScoreScore | AAA | BBB | CCC |
---|---|---|---|---|---|
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);
}
尾声
没了