正文
增加 176 行删除 135 行
2 行未改动345678910112 行未改动1415161718192021224 行未改动27282930313233343536373839404142434445464748495051525354555663 行未改动1201211221231241251261271282 行未改动1311321331341351361371381391401411421432 行未改动14614714814915015115215315415515615715815916016116216316416516616716816917061 行未改动232233234235236237238239240209 行未改动全部展开45045145245345445545645745845946046146246346446546630 行未改动49749849950050150250350450577 行未改动58358458558658758858959059114 行未改动60660760860961061161261361461561661761861962062162262334 行未改动65865966066166266366466566666715 行未改动68368468568668768868969069176 行未改动768769770771772773774775776118 行未改动全部展开89589689789889990090190290390490590690790816 行未改动92592692792892993093193293326 行未改动96096196296396496596696796896997097197297397412 行未改动987988989990991992993994995996997998999100010011002100310041005100623 行未改动1030103110321033103410351036103710388 行未改动10471048104910501051105210531054105522 行未改动10781079108010811082108310841085108648 行未改动1135113611371138113911401141114211433 行未改动11471148114911501151115211531154115513 行未改动11691170117111721173117411751176117723 行未改动1201120212031204120512061207120812093 行未改动121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312443 行未改动124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212 行未改动1285128612871288128912901291129212935 行未改动12991300130113021303130413051306130713 行未改动132113221323132413251326132713281329133032 行未改动13631364136513661367136813691370137110 行未改动1382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141073 行未改动14841485148614871488148914901491149232 行未改动1525152615271528152915301531153287 行未改动1620162116221623162416251626162716289 行未改动16381639164016411642164316441645164628 行未改动1675167616771678167916801681168216836 行未改动16901691169216931694169516961697169847 行未改动174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317745 行未改动17801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318044 行未改动18091810181118121813181418151816181714 行未改动1832183318341835183618371838183918409 行未改动18501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188210 行未改动1893189418951896189718981899190019012 行未改动19041905190619071908190919101911191218 行未改动1931193219331934193519361937193819391940194141 行未改动1983198419851986198719881989199019911992199342 行未改动203620372038203920402041204220432044204520462047204820492050205120522053205412 行未改动2067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920909 行未改动210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212715 行未改动214321442145214621472148214921502151215221532154215521562157215821592 行未改动21622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221574 行未改动22902291229222932 行未改动何意味啊。让我们看看有这样的“特别提醒”的情况下,广东的选手们都整了些什么活吧。本次 noip 一共 1390 人参加,鉴于人数较少我使用地毯式搜索 `/*` 关键词(一共出现 950 次),共找到整活人 42 人,整活人的比例与 csp2025 和 noip2024 相比都略有提高(可能是之前只搜索了关键词而不是地毯式搜索导致的),但是整体注释长度减少,那种大段大段的歌词、游记和感言数量大大减少。不难看出,csps 分数越低(广东的 noip 准考证按照是否高中为第一关键字,csps 分数为第二关键字),整活人密度越高。注意后面有 eps 个人不按准考证号排序,是进行其他关键词搜索得到的。2 行未改动```cpp/*OI 生涯要这样子结束了吗……去年明明 AK 了 NOIP,今年怎么连 T2 都不会做怎么会有这么搞笑的人啊去年省选 CE 爆了 100,没进队今年 NOIP 直接炸。咋回事??4 行未改动100+20+48+40 @ 12:32Farewell, OI.upd: 想到了 tree 的 O(nm^2) @ 12:40。没写完。GG.*/```::::::info[2. GD-0065(注:省略若干行)]```cpp/*去年的GD-0228,但是炸了//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);*/63 行未改动0 15 5483903342 335678433 241951671 241951671 251607302*///庆祝上高中以来第一次在提高组难度的模拟赛或正赛不会 T2//conguratulations(I forget how to spell this qwq) my first time have not solved the second problem of one contest which difficulty is close to NOIP after become a senior high school student//AFOed.(2022.9~2025.11.29)```:::2 行未改动candy```cpp/*8:37 虽然不能严格证明但是我先试试贪心考场用不了 ctrl+/ ** 又可以用了?8:46 疑似正解想到8:54 过所有阳历,但是大洋里不给满啊*/```tree2 行未改动#include<bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(0);cin.tie(0);return 0;}/*9:52 T2 没思路,来想这个,但是想到一个自己觉得没问题的想法,但是是 On 复杂度,根本对不上,不知道为什么??9:57 手模样例2出问题*/```::::::info[7. GD-0233]sale```cpp/*呜呜呜又炸掉了 一点思路都没有,连特殊性质都不会。。。完蛋了。。。*/```::::::info[8. GD-0320]61 行未改动:::info[10. GD-0339]```cpp/*考前30min检查一次文件不要发呆,对的你你的训练时间*/```:::209 行未改动全部展开{for(int i=fl-1;i>=1;i--){if(b[i].w==1){x1=b[i].val;break;}}for(int i=fl+1;i<=n;i++){if(b[i].w==1){x2=b[i].val;break;}}30 行未改动int l,t;cin>>l>>t;while(t--){scanf("%d%d",&n,&m);for(int i=1;i<=n;i++){int x;77 行未改动//if(fl1==0||fl2==0)return 0;if(a[t1].val+a[t2].val>=a[x].val){a[t1].w=2;return 2;}cout<<"t1t2:"<<t1<<" "<<t2<<endl;14 行未改动}elseif(a[i].val>=a[t1].val+a[t2].val){}else{cnt2++;}}a[t1].w=2;int delta=(m-2)-(t1-1);cout<<cnt1<<" "<<cnt2<<" "<<delta<<endl;for(int i=0;i<=cnt1;i++){if(i>=0&&i-delta>=0&&i-delta<=cnt2)ans+=C[cnt1][i]*C[cnt2][i-delta]*pow(2,n-t2+1);34 行未改动cout<<pow(2,n)-ans;return 0;}最后一场比赛了,安息吧,多做自己喜欢做的事情吧mug2025 11 29 深圳高三最后一年了,好好休息,要有清醒的头脑,才好去思考,去做事情嘛还有警惕泥潭非曰能之,愿学焉15 行未改动}/*5 54839 3356 2516 2419 2419最后发现暴力还挂了印象中我检查了,但好像事实就是没检查*/```:::76 行未改动void solveA(){sort(nn+1,nn+n+1,cmpA);an=(m*1/nn[1].x);}bool cmpB(candy A,candy B){return ((A.x-A.y)==(B.x-B.y)?A.x<B.x:(A.x-A.y)<(B.x-B.y));}118 行未改动全部展开int main() {scanf("%d%d",&c,&T);/*if(c>=1 && c<=5) {//����dfs(1);}*/scanf("%d%d",&n,&m);for(int i=1;i<=n;i++) scanf("%d",&a[i]);printf("%lld",KSM(2,n)%MOD);return 0;}```16 行未改动bool cmp(const int a,const int b){return tree[a].ss>tree[b].ss;}int dp(const int a){return tree[a].ss+1;if(tree[a].ss>0){int max1=0,sum=0;for(int i=0;i<tree[a].ss;i++){26 行未改动int n,t;int m,sum=0,tmp,mxdp,mx;scanf("%d",&t);while(t--){mxdp=0;mx=1;scanf("%d%d",&n,&m);for(int i=1;i<=n;i++){tree[i]={1,0,1};pd[i]=0;}for(int i=2;i<=n;i++){scanf("%d",&tmp);tree[i].f=tmp;12 行未改动printf("%lld\n",pd(1));//ans1=0;}return 0;}/*本题思维:观察到,树的价值为1<=i<=n的s_i之和,s_i为结点i的子树中不存在的最小的非零整数贪心策略?树型DP?由于数据量达到了8000,推测做法复杂度为n^2树的高度最高为800,是否有提示?!!!!每次选择最长链即可!用O(nlogn)复杂度找到最优解法,最长链记得初始化25 21 1 2 27 223 行未改动// cout<<dp[m];//}#include<bits/stdc++.h>using namespace std;#define int long longconst int N=1e6;int n,m;int v[N],w[N];int dp[N];8 行未改动while(b!=0){if(b%2==1)res*=a;a*=a;b>>=1;}return res;}void init(int x)22 行未改动}}// cout<<dp[m]<<endl;// printf("FINNNALLY\n");//dp[m]存着在当前w下的最大原价}int sum=1;bool cmp(node a,node b){48 行未改动}if(fl==0){solveA();return ;}int cnt=0;// cout<<ksm(2,n);int res=0;3 行未改动// for(int j=n;j>=1;j--)cout<<w[j]<<" ";// cout<<endl;cnt++;dps();// printf("LAST--------\n");// cout<<dp[m]<<" "<<moni()<<endl;if(dp[m]==moni()){res++;13 行未改动while(t--){solve();}}/*0 13 21 3 523 行未改动bool cmp(int a, int b){return dot_size[a] > dot_size[b];}int pre_dfs(int rot){// 预处理,给每个点计算其子树的大小,并将点的孩子按照子树大小排好序dot_size[rot] = 1;for(int i = 0; i < son[rot].size()-1; i++){dot_size[rot] += pre_dfs(son[rot][i]);}3 行未改动void work_dfs(int rot, int pre_fa, int last_bro){int pre_bro = -1;for(int i = 0; i < son[rot].size(); i++){work_dfs(son[rot][i], rot, pre_bro);// 先将子树递归下去pre_bro = son[rot][i];}//现在已经将rot的子树全部解决if(son[rot].size() == 0){// 若它是叶子节点S[rot] = -1;// 没有集合}// 选择对齐左边节点:if(last_bro != -1) {S[rot] = S[son[rot][i]] + 1;work_dfs()}work_dfs()}int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);freopen("tree.in", "r", stdin);freopen("tree.out", "w", stdout);cin >> t;while(t--){cin >> n >> m;for(int i = 2; i <= m; i++){3 行未改动}dot_size[1] = pre_dfs(1);memset(S, -1, sizeof S);// 此时已经处理好// 主算法:思路:/*上面已经进行了预处理接下来进行前序遍历,子树较大的孩子先计算后面的孩子有两个选择:{将权值定为它子树集合S[i]中,不在集合S[i]中的最小非负整数;将权值定位它父亲节点S[pi]中。。。。整数DFS枚举能拿30分*/work_dfs(rot);}return 0;}```:::12 行未改动return A.x + A.y < B.x + B.y;}int b[100010], _;bool ts1;int sb; //sum of b[], not sha**.int ans;signed main() {freopen("candy.in", "r", stdin);freopen("candy.out", "w", stdout);5 行未改动}sort(a + 1, a + n + 1, cmp1);if(ts1) {cout << m / a[1].x << endl;return 0;}for(int i = 1; i <= n; i++) {b[i] = a[i].x;}13 行未改动*/``````cpp/*放个 cpp 在这假装我做了这道题。*/#include<bits/stdc++.h>//#define int long longusing namespace std;32 行未改动using namespace std;const int mod=998244353;int c,t;int dp[10][10];// dp_mask,iint qow2[5010];int main(){freopen("sale.in","r",stdin);10 行未改动for(int i=1;i<=n;i++){cin>>x;a.push_back(x);}if(c==18) {cout<<qow2[n]<<endl;continue;}else{cout<<0<<endl;}}return 0;}/*10:18 T2这个题面描述有点诡异 看懂了 暴力几乎是不可做的首先要发现小R在贪心的买东西 我们要找到贪心策略不优时的情况数 容斥一下这个dp方程到底怎么写 好绝望10:53 推了半小时T3没有结果10:58 T2是状压dp? 今年这个T1过于一眼1=分数线应该会高12:03 好绝望。AFOing 写不出来的话就只能退役了啊 目前预估得分110 这连22年1=线都没有的分数。*/```::::::info[25. GD-0786 MC大神]73 行未改动Luogu AcceptedLuogu TLELuogu MLELuogu Wrong answerLuoguLuoguLuoguLuoguLuogu32 行未改动LuoguLuoguLuoguLuogufreeopenfreeopenfreeopenfreeopen87 行未改动:::info[27. GD-0815]```cpp//不要被误导了去用dp//贪心才是正解//比s组T1简单```:::9 行未改动#define f <=#define g 911#define z(x) if(x)#define tree "query.out"#define k goto#define a freopen#define q "I "#define w "don't "#define t 114528 行未改动}}//I don't understand!//过去了一个小时,T1还是没写出来//四个半小时死磕T1(因为其他题都看不懂(首 首 首))//打暴力骗分吧qwq//来钓鱼/*#include<bits\stdc++.h>;6 行未改动*///T1都做不出来 我也是彻底完蛋了//还感冒了,头晕晕的awa//旁边dalao打代码咔咔响,吵死了//今年没了,明年再来吧//不知道会不会上洛谷hhh```:::47 行未改动:::info[32. GD-1199 掉了]```cpp/*掉了....最后7分钟就这样吧。*/```::::::info[33. GD-1204 颗秒!]```cpp/*第一题A了颗秒!*/```::::::info[34. GD-1257 遗憾离场]```cpp// 9:49 20pts//12:46 ~20pts/*再见了,OI140pts 遗憾离场*/```:::5 行未改动const int N=1e5+5;signed main(){//freopen("query.in","r",stdin);//freopen("query.out","w",stdout);ios::sync_with_stdio(false);cin.tie(0);cout<<"已完成今日对于每次询问,设包含 i (1 ≤ i ≤ n) 的极好区间的最大权值为 ki,输出一行一个非负整数,表示 ⊕n i=1 ((i × ki) mod 2 64),其中 ⊕ 表示二. 进. 制. 按. 位. 异. 或. 。注意:对于任意整. 数.x,存在唯. 一. 的. 非. 负. 整. 数.x′ 满足 x′ ≡ x (mod 2 64) 且 0 ≤ x ′ ≤ 2 64 ? 1,则记x mod 2 64 = x大学习";return 0;}/*我们必须想象被形式化输出格式卡住不能写暴力的OIer是幸福的。报告长官,这太难了,我做不到!那就去猛击自己魔丸325下!苦也,这也言周?*/```:::4 行未改动//slove//freopen("candy.ans","r",stdout);``````cppThe length is a secretI love CCF very much!Can you help me ac test 6?My answer is smaller than CCF's14 行未改动I just have 1 yearDon't say "恭喜接广"I will be sad if you do that91 don't give me money at any timeI love CCF very much!Can you help me ac test 6?My answer is smaller than CCF'sI can't believe my code is wrong9 行未改动::::::info[37. GD-1295 崩铁启动]```cpp//T3#include<iostream>#include<vector>using namespace std;const int si=8e3+10;int n,m;int fa[si];//父亲vector<int> son[si];//儿子int size[si];//子树大小int an[si];//自己做根最大值int l[si];//重链长度int s[si];//重儿子int ql[si];//奇链长度int qs[si];//奇儿子int cal(int p,int cnt){if(qs[p]==-1)return cnt;int re=cal(qs[p],cnt+1)+cnt;//if(p==6)cout<<re<<' '<<cnt<<'\n';for(auto u:son[p]){if(u==qs[p])continue;re+=max(an[u],size[u]*cnt);}return re;}void dfs(int p){s[p]=-1;size[p]=l[p]=an[p]=1;for(auto u:son[p]){dfs(u);size[p]+=size[u];10 行未改动ql[p]=ql[u]+l[p];qs[p]=u;}ls=max(ls,l[u]);}//奇是重if(ls+ql[s[p]]+1>ql[p]){ql[p]=ls+ql[s[p]]+1;qs[p]=s[p];2 行未改动ql[p]=ql[son[p][0]]+1;qs[p]=s[p];}an[p]=cal(p,1);}int mian(){scanf("%d%d",&n,&m);for(int i=1;i<=n;i++)son[i].clear();18 行未改动/*10:30 这是重链剖分吗11:00 怎么实现......会做不会写11:30 我不信了!我要跟它死磕到底!!!12:00 奇链,昔涟。railway启动!!!12:30 冲冲冲!!!debuging;I feel tired. Who can help me? :(*/```::::::info[38. GD-1305 how to unique]41 行未改动for(int j=0;j<n;j++)for(int k=m;k>=p[j].y;k--)f[k]=max(f[k-p[j].y]+p[j].x/(3-p[j].y),f[k]);for(int j=0;j<=m;j++) tres=max(tres,f[j]);//cout<<tres<<" "<<res<<"\n";if(tres==res) ++cnt;}cout<<cnt%mod<<"\n";}void case2(){//wait, How to unique?42 行未改动int dp[100],n,m,c[100],val[100],t;struct A{long double a,b;bool operator<(const A other) const {return a<other.a;}};std::vector<A> v;int dfs(int k){if(k==n+1){std::fill(dp,dp+m+1,0);for(int i=1;i<=n;i++){for(int j=m;j>=1;j--){if(c[i]==1&&j>=1){dp[j]=std::max(dp[j],dp[j-1]+val[i]);}else if(c[i]==2&&j>=2){dp[j]=std::max(dp[j],dp[j-2]+val[i]);}}12 行未改动i++;if(sth<1)continue;sth-=1;result+=val[i-1+1];}else{j++;if(sth<2)continue;sth-=2;result+=val[j-1+1];}}// std::cout<<dp[m]<<' '<<result<<'\n';if (dp[m]!=result){return 1;}else{return 0;}}int ans=0;for(c[k]=1;c[k]<=2;c[k]++){ans+=dfs(k+1);}9 行未改动#endifint ccf=0;std::cin>>ccf>>t;for(int o=1;o<=t;o++){std::cin>>n>>m;v.clear();for(int i=1;i<=n;i++){std::cin>>val[i];v.push_back({val[i],val[i]/2});}std::sort(v.begin(),v.end(),std::less<A>());std::cout<<(int(pow(2,n))%p-dfs(1)+p)%p<<'\n';}return 0;}```::::::info[42. GD-0390&GD-0775 rp++]```cpp#include<bits/stdc++.h>using namespace std;#define ll long long#define fir first#define sec second#define pii pair<int,int>const int N=5e4+7;15 行未改动}inline int rs(int x){return x<<1|1;}void push_up(int x){ans[x]=ans[ls(x)]+ans[rs(x)];}void build(int x,int l,int r){if(l==r){ans[x]=a[l];return;}int mid=l+r>>1;build(ls(x),l,mid);build(rs(x),mid+1,r);push_up(x);2 行未改动ll query(int x,int l,int r,int nl,int nr){if(nl<=l&&r<=nr){return ans[x];}int mid=l+r>>1;ll res=0;if(nl<=mid)res+=query(ls(x),l,mid,nl,nr);if(mid<nr)res+=query(rs(x),mid+1,r,nl,nr);return res;}int main(){inputtt();cin>>n;for(int i=1;i<=n;i++){scanf("%d",&a[i]);}int q;cin>>q;for(int rp=1;rp<=q;rp++){int l,r;scanf("%d%d",&l,&r);unsigned ll ans=0;for(int i=1;i<=n;i++){ll maxx=0;for(int j=1;j<=i;j++){for(int k=i;k<=n;k++){if(k-j+1>=l&&k-j+1<=r)maxx=max(maxx,query(1,1,n,j,k));// cout<<query(1,1,n,j,k)<<endl;}}// cout<<maxx<<endl;ans^=(unsigned long long)i*maxx;}cout<<ans<<endl;}return 0;}/*42 4 -5 1374 行未改动return 0;}```:::2 行未改动345678910112 行未改动1415161718192021224 行未改动27282930313233343536373839404142434445464748495051525354555663 行未改动1201211221231241251261271282 行未改动1311321331341351361371381391401411421432 行未改动14614714814915015115215315415515615715815916016116216316416516616716816917061 行未改动232233234235236237238239240209 行未改动全部展开45045145245345445545645745845946046146246346446546630 行未改动49749849950050150250350450577 行未改动58358458558658758858959059114 行未改动60660760860961061161261361461561661761861962062162262334 行未改动65865966066166266366466566666715 行未改动68368468568668768868969069176 行未改动768769770771772773774775776118 行未改动全部展开89589689789889990090190290390490590690790816 行未改动92592692792892993093193293326 行未改动96096196296396496596696796896997097197297397412 行未改动987988989990991992993994995996997998999100010011002100310041005100623 行未改动1030103110321033103410351036103710388 行未改动10471048104910501051105210531054105522 行未改动10781079108010811082108310841085108648 行未改动1135113611371138113911401141114211433 行未改动11471148114911501151115211531154115513 行未改动11691170117111721173117411751176117723 行未改动1201120212031204120512061207120812093 行未改动121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312443 行未改动124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212 行未改动1285128612871288128912901291129212935 行未改动12991300130113021303130413051306130713 行未改动132113221323132413251326132713281329133032 行未改动13631364136513661367136813691370137110 行未改动1382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141073 行未改动1484148514861487148814891490149132 行未改动15241525152615271528152915301531153287 行未改动1620162116221623162416251626162716289 行未改动16381639164016411642164316441645164628 行未改动1675167616771678167916801681168216836 行未改动16901691169216931694169516961697169847 行未改动174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317745 行未改动17801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318044 行未改动18091810181118121813181418151816181714 行未改动1832183318341835183618371838183918409 行未改动18501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188210 行未改动1893189418951896189718981899190019012 行未改动19041905190619071908190919101911191218 行未改动1931193219331934193519361937193819391940194141 行未改动1983198419851986198719881989199019911992199342 行未改动203620372038203920402041204220432044204520462047204820492050205120522053205412 行未改动2067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920909 行未改动210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212715 行未改动214321442145214621472148214921502151215221532154215521562157215821592 行未改动21622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221574 行未改动2290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342 行未改动何意味啊。让我们看看有这样的“特别提醒”的情况下,广东的选手们都整了些什么活吧。本次 noip 一共 1390 人参加,整活人的比例与 csp2025 和 noip2024 相比都略有提高(可能是之前只搜索了关键词而不是地毯式搜索导致的),但是整体注释长度减少,那种大段大段的歌词、游记和感言数量大大减少。不难看出,csps 分数越低(广东的 noip 准考证按照是否高中为第一关键字,csps 分数为第二关键字),整活人密度越高。注意后面有 eps 个人不按准考证号排序,是进行其他关键词搜索得到的。2 行未改动```cpp/*OI 生涯要这样子结束了吗……去年明明 AK 了 NOIP,今年怎么连 T2 都不会做怎么会有这么搞笑的人啊去年省选 CE 爆了 100,没进队今年 NOIP 直接炸。咋回事??4 行未改动100+20+48+40 @ 12:32Farewell, OI.upd: 想到了 tree 的 O(nm^2) @ 12:40。没写完。GG.*/```::::::info[2. GD-0065(注:省略若干行)]```cpp/*去年的GD-0228,但是炸了//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);//freopen("query1.in","r",stdin);//freopen("query.in","w",stdin);//freopen("query.in","r",stdin);//freopen("query.in","w",stdout);*/63 行未改动0 15 5483903342 335678433 241951671 241951671 251607302*///庆祝上高中以来第一次在提高组难度的模拟赛或正赛不会 T2//conguratulations(I forget how to spell this qwq) my first time have not solved the second problem of one contest which difficulty is close to NOIP after become a senior high school student//AFOed.(2022.9~2025.11.29)```:::2 行未改动candy```cpp/*8:37 虽然不能严格证明但是我先试试贪心考场用不了 ctrl+/ ** 又可以用了?8:46 疑似正解想到8:54 过所有阳历,但是大洋里不给满啊*/```tree2 行未改动#include<bits/stdc++.h>using namespace std;int main(){ios::sync_with_stdio(0);cin.tie(0);return 0;}/*9:52 T2 没思路,来想这个,但是想到一个自己觉得没问题的想法,但是是 On 复杂度,根本对不上,不知道为什么??9:57 手模样例2出问题*/```::::::info[7. GD-0233]sale```cpp/*呜呜呜又炸掉了 一点思路都没有,连特殊性质都不会。。。完蛋了。。。*/```::::::info[8. GD-0320]61 行未改动:::info[10. GD-0339]```cpp/*考前30min检查一次文件不要发呆,对的你你的训练时间*/```:::209 行未改动全部展开{for(int i=fl-1;i>=1;i--){if(b[i].w==1){x1=b[i].val;break;}}for(int i=fl+1;i<=n;i++){if(b[i].w==1){x2=b[i].val;break;}}30 行未改动int l,t;cin>>l>>t;while(t--){scanf("%d%d",&n,&m);for(int i=1;i<=n;i++){int x;77 行未改动//if(fl1==0||fl2==0)return 0;if(a[t1].val+a[t2].val>=a[x].val){a[t1].w=2;return 2;}cout<<"t1t2:"<<t1<<" "<<t2<<endl;14 行未改动}elseif(a[i].val>=a[t1].val+a[t2].val){}else{cnt2++;}}a[t1].w=2;int delta=(m-2)-(t1-1);cout<<cnt1<<" "<<cnt2<<" "<<delta<<endl;for(int i=0;i<=cnt1;i++){if(i>=0&&i-delta>=0&&i-delta<=cnt2)ans+=C[cnt1][i]*C[cnt2][i-delta]*pow(2,n-t2+1);34 行未改动cout<<pow(2,n)-ans;return 0;}最后一场比赛了,安息吧,多做自己喜欢做的事情吧mug2025 11 29 深圳高三最后一年了,好好休息,要有清醒的头脑,才好去思考,去做事情嘛还有警惕泥潭非曰能之,愿学焉15 行未改动}/*5 54839 3356 2516 2419 2419最后发现暴力还挂了印象中我检查了,但好像事实就是没检查*/```:::76 行未改动void solveA(){sort(nn+1,nn+n+1,cmpA);an=(m*1/nn[1].x);}bool cmpB(candy A,candy B){return ((A.x-A.y)==(B.x-B.y)?A.x<B.x:(A.x-A.y)<(B.x-B.y));}118 行未改动全部展开int main() {scanf("%d%d",&c,&T);/*if(c>=1 && c<=5) {//����dfs(1);}*/scanf("%d%d",&n,&m);for(int i=1;i<=n;i++) scanf("%d",&a[i]);printf("%lld",KSM(2,n)%MOD);return 0;}```16 行未改动bool cmp(const int a,const int b){return tree[a].ss>tree[b].ss;}int dp(const int a){return tree[a].ss+1;if(tree[a].ss>0){int max1=0,sum=0;for(int i=0;i<tree[a].ss;i++){26 行未改动int n,t;int m,sum=0,tmp,mxdp,mx;scanf("%d",&t);while(t--){mxdp=0;mx=1;scanf("%d%d",&n,&m);for(int i=1;i<=n;i++){tree[i]={1,0,1};pd[i]=0;}for(int i=2;i<=n;i++){scanf("%d",&tmp);tree[i].f=tmp;12 行未改动printf("%lld\n",pd(1));//ans1=0;}return 0;}/*本题思维:观察到,树的价值为1<=i<=n的s_i之和,s_i为结点i的子树中不存在的最小的非零整数贪心策略?树型DP?由于数据量达到了8000,推测做法复杂度为n^2树的高度最高为800,是否有提示?!!!!每次选择最长链即可!用O(nlogn)复杂度找到最优解法,最长链记得初始化25 21 1 2 27 223 行未改动// cout<<dp[m];//}#include<bits/stdc++.h>using namespace std;#define int long longconst int N=1e6;int n,m;int v[N],w[N];int dp[N];8 行未改动while(b!=0){if(b%2==1)res*=a;a*=a;b>>=1;}return res;}void init(int x)22 行未改动}}// cout<<dp[m]<<endl;// printf("FINNNALLY\n");//dp[m]存着在当前w下的最大原价}int sum=1;bool cmp(node a,node b){48 行未改动}if(fl==0){solveA();return ;}int cnt=0;// cout<<ksm(2,n);int res=0;3 行未改动// for(int j=n;j>=1;j--)cout<<w[j]<<" ";// cout<<endl;cnt++;dps();// printf("LAST--------\n");// cout<<dp[m]<<" "<<moni()<<endl;if(dp[m]==moni()){res++;13 行未改动while(t--){solve();}}/*0 13 21 3 523 行未改动bool cmp(int a, int b){return dot_size[a] > dot_size[b];}int pre_dfs(int rot){// 预处理,给每个点计算其子树的大小,并将点的孩子按照子树大小排好序dot_size[rot] = 1;for(int i = 0; i < son[rot].size()-1; i++){dot_size[rot] += pre_dfs(son[rot][i]);}3 行未改动void work_dfs(int rot, int pre_fa, int last_bro){int pre_bro = -1;for(int i = 0; i < son[rot].size(); i++){work_dfs(son[rot][i], rot, pre_bro);// 先将子树递归下去pre_bro = son[rot][i];}//现在已经将rot的子树全部解决if(son[rot].size() == 0){// 若它是叶子节点S[rot] = -1;// 没有集合}// 选择对齐左边节点:if(last_bro != -1) {S[rot] = S[son[rot][i]] + 1;work_dfs()}work_dfs()}int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);freopen("tree.in", "r", stdin);freopen("tree.out", "w", stdout);cin >> t;while(t--){cin >> n >> m;for(int i = 2; i <= m; i++){3 行未改动}dot_size[1] = pre_dfs(1);memset(S, -1, sizeof S);// 此时已经处理好// 主算法:思路:/*上面已经进行了预处理接下来进行前序遍历,子树较大的孩子先计算后面的孩子有两个选择:{将权值定为它子树集合S[i]中,不在集合S[i]中的最小非负整数;将权值定位它父亲节点S[pi]中。。。。整数DFS枚举能拿30分*/work_dfs(rot);}return 0;}```:::12 行未改动return A.x + A.y < B.x + B.y;}int b[100010], _;bool ts1;int sb; //sum of b[], not sha**.int ans;signed main() {freopen("candy.in", "r", stdin);freopen("candy.out", "w", stdout);5 行未改动}sort(a + 1, a + n + 1, cmp1);if(ts1) {cout << m / a[1].x << endl;return 0;}for(int i = 1; i <= n; i++) {b[i] = a[i].x;}13 行未改动*/``````cpp/*放个 cpp 在这假装我做了这道题。*/#include<bits/stdc++.h>//#define int long longusing namespace std;32 行未改动using namespace std;const int mod=998244353;int c,t;int dp[10][10];// dp_mask,iint qow2[5010];int main(){freopen("sale.in","r",stdin);10 行未改动for(int i=1;i<=n;i++){cin>>x;a.push_back(x);}if(c==18) {cout<<qow2[n]<<endl;continue;}else{cout<<0<<endl;}}return 0;}/*10:18 T2这个题面描述有点诡异 看懂了 暴力几乎是不可做的首先要发现小R在贪心的买东西 我们要找到贪心策略不优时的情况数 容斥一下这个dp方程到底怎么写 好绝望10:53 推了半小时T3没有结果10:58 T2是状压dp? 今年这个T1过于一眼1=分数线应该会高12:03 好绝望。AFOing 写不出来的话就只能退役了啊 目前预估得分110 这连22年1=线都没有的分数。*/```::::::info[25. GD-0786 MC大神]73 行未改动Luogu AcceptedLuogu TLELuogu MLELuogu Wrong answerLuoguLuoguLuoguLuogu32 行未改动LuoguLuoguLuoguLuoguLuogufreeopenfreeopenfreeopenfreeopen87 行未改动:::info[27. GD-0815]```cpp//不要被误导了去用dp//贪心才是正解//比s组T1简单```:::9 行未改动#define f <=#define g 911#define z(x) if(x)#define tree "query.out"#define k goto#define a freopen#define q "I "#define w "don't "#define t 114528 行未改动}}//I don't understand!//过去了一个小时,T1还是没写出来//四个半小时死磕T1(因为其他题都看不懂(首 首 首))//打暴力骗分吧qwq//来钓鱼/*#include<bits\stdc++.h>;6 行未改动*///T1都做不出来 我也是彻底完蛋了//还感冒了,头晕晕的awa//旁边dalao打代码咔咔响,吵死了//今年没了,明年再来吧//不知道会不会上洛谷hhh```:::47 行未改动:::info[32. GD-1199 掉了]```cpp/*掉了....最后7分钟就这样吧。*/```::::::info[33. GD-1204 颗秒!]```cpp/*第一题A了颗秒!*/```::::::info[34. GD-1257 遗憾离场]```cpp// 9:49 20pts//12:46 ~20pts/*再见了,OI140pts 遗憾离场*/```:::5 行未改动const int N=1e5+5;signed main(){//freopen("query.in","r",stdin);//freopen("query.out","w",stdout);ios::sync_with_stdio(false);cin.tie(0);cout<<"已完成今日对于每次询问,设包含 i (1 ≤ i ≤ n) 的极好区间的最大权值为 ki,输出一行一个非负整数,表示 ⊕n i=1 ((i × ki) mod 2 64),其中 ⊕ 表示二. 进. 制. 按. 位. 异. 或. 。注意:对于任意整. 数.x,存在唯. 一. 的. 非. 负. 整. 数.x′ 满足 x′ ≡ x (mod 2 64) 且 0 ≤ x ′ ≤ 2 64 ? 1,则记x mod 2 64 = x大学习";return 0;}/*我们必须想象被形式化输出格式卡住不能写暴力的OIer是幸福的。报告长官,这太难了,我做不到!那就去猛击自己魔丸325下!苦也,这也言周?*/```:::4 行未改动//slove//freopen("candy.ans","r",stdout);``````cppThe length is a secretI love CCF very much!Can you help me ac test 6?My answer is smaller than CCF's14 行未改动I just have 1 yearDon't say "恭喜接广"I will be sad if you do that91 don't give me money at any timeI love CCF very much!Can you help me ac test 6?My answer is smaller than CCF'sI can't believe my code is wrong9 行未改动::::::info[37. GD-1295 崩铁启动]```cpp//T3#include<iostream>#include<vector>using namespace std;const int si=8e3+10;int n,m;int fa[si];//父亲vector<int> son[si];//儿子int size[si];//子树大小int an[si];//自己做根最大值int l[si];//重链长度int s[si];//重儿子int ql[si];//奇链长度int qs[si];//奇儿子int cal(int p,int cnt){if(qs[p]==-1)return cnt;int re=cal(qs[p],cnt+1)+cnt;//if(p==6)cout<<re<<' '<<cnt<<'\n';for(auto u:son[p]){if(u==qs[p])continue;re+=max(an[u],size[u]*cnt);}return re;}void dfs(int p){s[p]=-1;size[p]=l[p]=an[p]=1;for(auto u:son[p]){dfs(u);size[p]+=size[u];10 行未改动ql[p]=ql[u]+l[p];qs[p]=u;}ls=max(ls,l[u]);}//奇是重if(ls+ql[s[p]]+1>ql[p]){ql[p]=ls+ql[s[p]]+1;qs[p]=s[p];2 行未改动ql[p]=ql[son[p][0]]+1;qs[p]=s[p];}an[p]=cal(p,1);}int mian(){scanf("%d%d",&n,&m);for(int i=1;i<=n;i++)son[i].clear();18 行未改动/*10:30 这是重链剖分吗11:00 怎么实现......会做不会写11:30 我不信了!我要跟它死磕到底!!!12:00 奇链,昔涟。railway启动!!!12:30 冲冲冲!!!debuging;I feel tired. Who can help me? :(*/```::::::info[38. GD-1305 how to unique]41 行未改动for(int j=0;j<n;j++)for(int k=m;k>=p[j].y;k--)f[k]=max(f[k-p[j].y]+p[j].x/(3-p[j].y),f[k]);for(int j=0;j<=m;j++) tres=max(tres,f[j]);//cout<<tres<<" "<<res<<"\n";if(tres==res) ++cnt;}cout<<cnt%mod<<"\n";}void case2(){//wait, How to unique?42 行未改动int dp[100],n,m,c[100],val[100],t;struct A{long double a,b;bool operator<(const A other) const {return a<other.a;}};std::vector<A> v;int dfs(int k){if(k==n+1){std::fill(dp,dp+m+1,0);for(int i=1;i<=n;i++){for(int j=m;j>=1;j--){if(c[i]==1&&j>=1){dp[j]=std::max(dp[j],dp[j-1]+val[i]);}else if(c[i]==2&&j>=2){dp[j]=std::max(dp[j],dp[j-2]+val[i]);}}12 行未改动i++;if(sth<1)continue;sth-=1;result+=val[i-1+1];}else{j++;if(sth<2)continue;sth-=2;result+=val[j-1+1];}}// std::cout<<dp[m]<<' '<<result<<'\n';if (dp[m]!=result){return 1;}else{return 0;}}int ans=0;for(c[k]=1;c[k]<=2;c[k]++){ans+=dfs(k+1);}9 行未改动#endifint ccf=0;std::cin>>ccf>>t;for(int o=1;o<=t;o++){std::cin>>n>>m;v.clear();for(int i=1;i<=n;i++){std::cin>>val[i];v.push_back({val[i],val[i]/2});}std::sort(v.begin(),v.end(),std::less<A>());std::cout<<(int(pow(2,n))%p-dfs(1)+p)%p<<'\n';}return 0;}```::::::info[42. GD-0390&GD-0775 rp++]```cpp#include<bits/stdc++.h>using namespace std;#define ll long long#define fir first#define sec second#define pii pair<int,int>const int N=5e4+7;15 行未改动}inline int rs(int x){return x<<1|1;}void push_up(int x){ans[x]=ans[ls(x)]+ans[rs(x)];}void build(int x,int l,int r){if(l==r){ans[x]=a[l];return;}int mid=l+r>>1;build(ls(x),l,mid);build(rs(x),mid+1,r);push_up(x);2 行未改动ll query(int x,int l,int r,int nl,int nr){if(nl<=l&&r<=nr){return ans[x];}int mid=l+r>>1;ll res=0;if(nl<=mid)res+=query(ls(x),l,mid,nl,nr);if(mid<nr)res+=query(rs(x),mid+1,r,nl,nr);return res;}int main(){inputtt();cin>>n;for(int i=1;i<=n;i++){scanf("%d",&a[i]);}int q;cin>>q;for(int rp=1;rp<=q;rp++){int l,r;scanf("%d%d",&l,&r);unsigned ll ans=0;for(int i=1;i<=n;i++){ll maxx=0;for(int j=1;j<=i;j++){for(int k=i;k<=n;k++){if(k-j+1>=l&&k-j+1<=r)maxx=max(maxx,query(1,1,n,j,k));// cout<<query(1,1,n,j,k)<<endl;}}// cout<<maxx<<endl;ans^=(unsigned long long)i*maxx;}cout<<ans<<endl;}return 0;}/*42 4 -5 1374 行未改动return 0;}```::::::info[43. GD-0699]```cpp//code by ZXZMC//hacked by ans6 qwq//it spend me 2.5h!!!//freopen("candy.in","r",stdin);//freopen("candy.out","w",stdout);//slove()//do not://x1,y1,x0,y0//freeopen()```::::::info[44. GD-0873]```cpp#include<bits/stdc++.h>using namespace std;int honkai_starrail,UID_152604873;int main(){freopen("query.in","r",stdin);freopen("query.out","w",stdout);// freopen("query.in","r",stdin);// freopen("query.out","w",stdout);/*#include<bits\stdc++.h>freopen("query.in",r,stdin);freopen("query.out",w,stdout);*/cin>>honkai_starrail;for(int i=1;i<=honkai_starrail;i++)cin>>UID_152604873;cin>>honkai_starrail;while(honkai_starrail--)cout<<152604873;return 0;}```::::::info[45. GD-0789]```cpp//mei man fen, jiu zhe yang ba, xi wang you jiu shi```:::