#include <bits/stdc++.h> using namespace std; using i64 = long long; const int maxn = 5e5 + 10; int dp[30]; bool ok[30][30], vis[30]; char s[maxn], t[maxn]; int main() { #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);...
B. dp,vector没开long long,好死 #include<bits/stdc++.h>usingnamespacestd;usingll=longlong;constintmaxn=1e4;llsum[maxn];llp[maxn];lla[maxn];lldp[111][111];lln;intmain(){scanf("%lld",&n);for(inti=1;i<=n;i++){scanf("%lld",&a[i]);p[i]=p[i-1]+a[i];if(i>1){s...
因此我们考虑如何快速计算出一段区间内的贡献t,贡献定义为能够进行最多多少次删除操作,最后答案就是max(0, len / 3 - t)。 我们发现我们可以用前缀和计算1 - i的区间贡献,我们单循环扫一遍即可。但是一个左右端点都不确定的区间的贡献是不是s[r] - s[l - 1]呢?显然因为有环的存在,是不对的。加入有...
· The 2023 ICPC Asia EC Regionals Online Contest (I) - Problem C. Multiply Then Plus · 2021“MINIEYE杯”中国大学生算法设计超级联赛(3) · Kruskal 重构树学习笔记 · 【题解】UVA10099 The Tourist Guide 【Kruskal 重构树】 · Kruskal重构树小记 阅读排行: · 如何给本地部署的DeepSeek...
(v.begin(), v.end()); // 按分数降序排 map<string, int> cnt; vector<int> ans(n); int cur = 0; for (int i = 0; i < n; i++) { if (cnt[v[i].ut] < minn) // v[i]所属大学的名额还有 { cur++; cnt[v[i].ut]++; } ans[v[i].id] = cur; } for...
The 2021 ICPC Asia Regionals Online Contest (I) G Longest Prefix Matching (trie),题意:给你$n$个ip地址,以及长度和它所对应的nextip地址,有$m$个询问,在$n$个给定的ip地址中找到公共前缀大于所给长度并且最长的对应ip地址。(疯狂口胡)题解:每个ip地址有四个数
The 2021 ICPC Asia Regionals Online Contest (I)补题,INeiborhoodSearch题意:签到题思路:主要是学习stringstream,记得加头文件sstream注:当时以为这个题会卡A的范围,就开始找大数,因为最开始就是类似这样写的,没有用stringstream,只是普通的读入,后来才发现就是
Problem Setter Team, which was the fourth time for us to prepare the Nanjing Regional Contest. Due to the covid pandemic, the previous three Nanjing regionals were held online. As the pandemic has come to an end, we can finally gather in NUAA to participate in this wonderful contest. ...
Just a few hours ago, The 2021 ICPC Asia Regionals Online Contest (I) was held onhttps://pintia.cn/. This contest(and the next on 26th) will determine the WHOLE Asia-East Division‘s quota. And how fantastic(according to some coaches) of these problems in this online contest? I uploa...
Then regionals happened. The University of North Florida, site of the East Regional, had recently redone their cage, and in the remodeled version the hammer ring was placed in front of the discus ring. Because of this, the cage door felt closer than normal for the hammer throwers, which ...