版本比较
11/09 noip 总结
正文
增加 8 行删除 8 行
10 行未改动1112131415161718192021163 行未改动全部展开18518618718818919019119219320 行未改动21421521621721821922022122213 行未改动236237238239240241242243244245246149 行未改动全部展开39639739839940040140240340417 行未改动422423424425426427428429430123 行未改动全部展开10 行未改动```cpp lines=148-151,134-137,119-122#include<bits/stdc++.h>#define lr ro*2#define rr ro*2+1#define mid ((l+r)/2)#define int long longusing namespace std;const int N=5e5;int w[N];int n,m;163 行未改动全部展开dfs(1,0);for(auto [x,y,z]:ed){w[get_s(x,y)]=z;}build();while(1){string op;cin>>op;20 行未改动cin>>u>>v;cout<<query_p(u,v)<<endl;}}return 0;}```### T213 行未改动~~由于我从 T1 复制过来的时候想改最少,就使用了 unmap 这种歪路子实现动态开点线段树。~~```#include<bits/stdc++.h>#define lr ro*2#define rr ro*2+1#define mid ((l+r)/2)#define int long longusing namespace std;const int N=5e5;int n,m;vector<int>g[N];149 行未改动全部展开cin>>x>>y>>u>>v;int ans=gdis(u,v)-query_p(x,u,v)+query_pc(x,u,v)*y;cout<<ans<<endl;}return 0;}```17 行未改动#include <bits/stdc++.h>#define lr ro*2#define rr ro*2+1#define mid (l+r)/2#define int long longusing namespace std;const int N=1e5+5,M=2e5+5,logN=17+1;int n,m,root,idx,a[N],f[N][logN],dfn[N],seq[N],sz[N],dep[N];int tot,lnk[N],ter[M],nxt[M];123 行未改动全部展开10 行未改动1112131415161718192021163 行未改动全部展开18518618718818919019119219320 行未改动21421521621721821922022122213 行未改动236237238239240241242243244245246149 行未改动全部展开39639739839940040140240340417 行未改动422423424425426427428429430123 行未改动全部展开10 行未改动```cpp lines=148-151,134-137,119-122#include<bits/stdc++.h>#define lr ro*2#define rr ro*2+1#define mid ((l+r)/2)#define int long longusing namespace std;const int N=5e5;int w[N];int n,m;163 行未改动全部展开dfs(1,0);for(auto [x,y,z]:ed){w[get_s(x,y)]=z;}build();while(1){string op;cin>>op;20 行未改动cin>>u>>v;cout<<query_p(u,v)<<endl;}}return 0;}```### T213 行未改动~~由于我从 T1 复制过来的时候想改最少,就使用了 unmap 这种歪路子实现动态开点线段树。~~```#include<bits/stdc++.h>#define lr ro*2#define rr ro*2+1#define mid ((l+r)/2)#define int long longusing namespace std;const int N=5e5;int n,m;vector<int>g[N];149 行未改动全部展开cin>>x>>y>>u>>v;int ans=gdis(u,v)-query_p(x,u,v)+query_pc(x,u,v)*y;cout<<ans<<endl;}return 0;}```17 行未改动#include <bits/stdc++.h>#define lr ro*2#define rr ro*2+1#define mid (l+r)/2#define int long longusing namespace std;const int N=1e5+5,M=2e5+5,logN=17+1;int n,m,root,idx,a[N],f[N][logN],dfn[N],seq[N],sz[N],dep[N];int tot,lnk[N],ter[M],nxt[M];123 行未改动全部展开