前言
我好菜
成绩
%%%TRXdalao\%\%\% TRXdalao%%%TRXdalao
RankRankRank | PersonPersonPerson | ScoreScoreScore | AAA | BBB | CCC |
---|---|---|---|---|---|
888 | (H−2)TRX(H-2)TRX(H−2)TRX | 120120120 | 202020 | 100100100 | 000 |
121212 | (H−2)HJW(H-2)HJW(H−2)HJW | 100100100 | 100100100 | 000 | 000 |
181818 | (J−3)XXY(J-3)XXY(J−3)XXY | 808080 | 404040 | 202020 | 202020 |
292929 | (J−3)ZYC(J-3)ZYC(J−3)ZYC | 606060 | 202020 | 202020 | 202020 |
333333 | (J−3)WYC(J-3)WYC(J−3)WYC | 505050 | 404040 | 000 | 101010 |
333333 | (J−3)LRZ(J-3)LRZ(J−3)LRZ | 505050 | 202020 | 202020 | 101010 |
353535 | (H−2)LZX(H-2)LZX(H−2)LZX | 454545 | 000 | 454545 | 000 |
474747 | (J−3)LW(J-3)LW(J−3)LW | 252525 | 202020 | 555 | 000 |
474747 | (J−3)XJQ(J-3)XJQ(J−3)XJQ | 252525 | 000 | 252525 | 000 |
505050 | (J−3)HZB(J-3)HZB(J−3)HZB | 202020 | 202020 | 000 | 000 |
正题
T1:jzoj2908,P1527−[T1:jzoj2908,P1527-[T1:jzoj2908,P1527−[集训队互测2012]2012]2012]矩阵乘法【整体二分,,,二维树状数组】
链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/100048345
T2:jzoj3410−[GDOI2014T2:jzoj3410-[GDOI2014T2:jzoj3410−[GDOI2014模拟]Tree]Tree]Tree【最小生成树,,,贪心】
链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/100048388
T3:jzoj3682−PointsandSegmentsT3:jzoj3682-Points and SegmentsT3:jzoj3682−PointsandSegments【模型转化,,,欧拉回路】
链接:
https://blog.csdn.net/Mr_wuyongcong/article/details/100048396
总结
T1T1T1有想过是整体二分,但是不会。T2T2T2没思路,T3T3T3写了个贪心结果连题意都看错了QVQQVQQVQ。
SomeofcodeSome\ of\ codeSome of code
T140ptscodeT1\ 40pts\ codeT1 40pts code
#pragma GCC optimize(2)
%:pragma GCC optimize(3)
%:pragma GCC optimize("Ofast")
%:pragma GCC optimize("inline")
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=501;
int n,q,cnt,a[N][N],y[N*N],x[N][N];
short v[N][N][N];
int check(int x1,int y1,int x2,int y2,int X)
{int ans=0;if(x1>x2)swap(x1,x2);if(y1>y2)swap(y1,y2);for(int i=x1;i<=x2;i++){int w=upper_bound(x[i]+1,x[i]+1+n,X)-x[i]-1;ans+=v[i][y2][w]-v[i][y1-1][w];}return ans;
}
int main()
{scanf("%d%d",&n,&q);for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)scanf("%d",&a[i][j]),x[i][j]=a[i][j],y[++cnt]=a[i][j];sort(y+1,y+1+cnt);for(int i=1;i<=n;i++)sort(x[i]+1,x[i]+1+n);for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)for(int k=1;k<=n;k++)v[i][j][k]=v[i][j-1][k]+(a[i][j]<=x[i][k]); while(q--){int x1,y1,x2,y2,k;scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&k);int l=1,r=cnt;while(l<=r){int mid=(l+r)>>1;if(check(x1,y1,x2,y2,y[mid])>=k) r=mid-1;else l=mid+1;}printf("%d\n",y[l]);}
}
/*
4 4
9 9 9 9
9 7 9 9
9 9 8 6
9 9 9 9
1 1 4 4 3
*/
T310ptscodeT3\ 10pts\ codeT3 10pts code
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stack>
using namespace std;
const int N=1e5+100;
struct node{int l,pos;
}a[N];
int n,r[N],ans[N],z;
stack<int> s;
bool cMp(node x,node y)
{return x.l<y.l;}
int main()
{scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d%d",&a[i].l,&r[i]);a[i].pos=i;}sort(a+1,a+1+n,cMp);sort(r+1,r+1+n);int l=1;for(int i=1;i<=n;i++){while(l<=n&&a[l].l<=r[i]) s.push(l++);if(a[s.top()].l!=r[i]) z^=1;ans[a[s.top()].pos]=z;s.pop();}for(int i=1;i<=n;i++)printf("%d ",ans[i]);
}