前言
在短暂的比赛时间中,我发现本菜鸡越是功于心计想ACACAC,越是拿不到分,所以。。。
我不写比赛了JOJO!JOJO!JOJO!
成绩
JJJ表示初中,HHH表示高中后面加的是几年级
RankRankRank | PersonPersonPerson | ScoreScoreScore | AAA | BBB | CCC |
---|---|---|---|---|---|
141414 | (H−2)HJW(H-2)HJW(H−2)HJW | 190190190 | 505050 | 100100100 | 404040 |
252525 | (H−1)ZZY(H-1)ZZY(H−1)ZZY | 160160160 | 505050 | 100100100 | 101010 |
323232 | (J−3)WYC(J-3)WYC(J−3)WYC | 140140140 | 000 | 100100100 | 404040 |
515151 | (J−3)LRZ(J-3)LRZ(J−3)LRZ | 100100100 | 505050 | 505050 | 000 |
515151 | (J−3)XXY(J-3)XXY(J−3)XXY | 100100100 | 505050 | 505050 | 000 |
676767 | (H−1)QYH(H-1)QYH(H−1)QYH | 808080 | 000 | 505050 | 303030 |
757575 | (J−3)HZB(J-3)HZB(J−3)HZB | 707070 | 505050 | 202020 | 000 |
757575 | (H−1)WHF(H-1)WHF(H−1)WHF | 707070 | 505050 | 000 | 202020 |
757575 | (H−2)LZX(H-2)LZX(H−2)LZX | 707070 | 505050 | 202020 | 000 |
868686 | (J−3)ZYC(J-3)ZYC(J−3)ZYC | 505050 | 505050 | 000 | 000 |
929292 | (J−3)LW(J-3)LW(J−3)LW | 404040 | 404040 | 000 | 000 |
959595 | (J−3)XJQ(J-3)XJQ(J−3)XJQ | 303030 | 303030 | 000 | 000 |
105105105 | (J−3)HJQ(J-3)HJQ(J−3)HJQ | 101010 | 101010 | 000 | 000 |
112112112 | (H−2)YJY(H-2)YJY(H−2)YJY | 000 | 000 | 000 | 000 |
正题
T1:jzoj6275−[NOIPT1:jzoj6275-[NOIPT1:jzoj6275−[NOIP提高组模拟1]1]1]小LLL的数列【矩阵乘法,,,欧拉定理】
链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/98773342
T2:jzoj6274−[NOIPT2:jzoj6274-[NOIPT2:jzoj6274−[NOIP提高组模拟1]1]1]梦境【贪心,,,堆】
链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/98759584
T3:jzoj6276−[NOIPT3:jzoj6276-[NOIPT3:jzoj6276−[NOIP提高组模拟1]1]1]树【线段树,,,扫描线,,,倍增】
链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/98762651
总结
今天T1T1T1一看矩阵乘法扩展欧拉定理(然而并不用扩展)写了半天发现思路全错(其实接近正确),然后就去看T2T2T2发现贪心性质十分显然但是过程比较麻烦。先写了个线段树结果发现并不用写,后来写了个堆就切了。然后T3T3T3开始以为是点分治,但是后来发现我的方法得加一个主席树就不写了,然后发现菊花图和链特别好写就写了,然后结果菊花图写挂了只拿到了404040。
看题预估分50+50+70=12050+50+70=12050+50+70=120
做题预估分10+100+70=18010+100+70=18010+100+70=180
实际获得分0+100+40=1400+100+40=1400+100+40=140
SomeofcodeSome\ of\ codeSome of code
T340ptscodeT3\ 40pts\ codeT3 40pts code
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
const int N=100100;
int n,m,p[N][2],dfn[N],rfn[N],cnt,tot,out[N],ls[N],ans,v[N];
vector<int> d[N];
struct Edge_node{int to,next;
}a[N*2];
void addl(int x,int y)
{a[++tot].to=y;a[tot].next=ls[x];ls[x]=tot;out[x]++;
}
void dfs(int x,int fa)
{dfn[++cnt]=x;rfn[x]=cnt;for(int i=ls[x];i;i=a[i].next){int y=a[i].to;if(y==fa) continue;dfs(y,x);}
}
int main()
{freopen("tree.in","r",stdin);freopen("tree.out","w",stdout);scanf("%d%d",&n,&m);for(int i=1;i<n;i++){int x,y;scanf("%d%d",&x,&y);addl(x,y);addl(y,x);}for(int i=1;i<=m;i++){int x,y;scanf("%d%d",&x,&y);d[x].push_back(i);d[y].push_back(i);p[i][0]=x;p[i][1]=y;}if(out[1]==n-1){for(int i=2;i<=n;i++){int num=n-1;for(int j=0;j<d[i].size();j++){bool flag=(d[i][j]>m),mark=d[i][j]-flag*m,y=p[mark][flag^1];if(y==1){num=0;break;}num--;}ans+=num;}printf("%d",ans);return 0;}for(int i=1;i<=n;i++)if(out[i]==1){dfs(i,0);break;}for(int i=1;i<=m;i++){p[i][0]=rfn[p[i][0]];p[i][1]=rfn[p[i][1]];if(p[i][0]>p[i][1])swap(p[i][0],p[i][1]);}int l=0;for(int i=1;i<=n;i++){for(int j=0;j<d[dfn[i]].size();j++){int val=d[dfn[i]][j];v[val]++;if(v[val]<2) continue;l=max(l,p[val][0]);}ans+=max(i-l-1,0);}printf("%d",ans);
}