2 : 1; } int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; std::cin >> n; std::string s; std::cin >> s; { auto Do = [&](int t) -> void { dp[0][t][state(t)] = 1; }; if (s[0] >= 'a' and s[0] <= 'z') { Do(s[0...
#include<bits/stdc++.h>usingnamespacestd;intmain(){intn,m;cin>>n>>m;vector<string>a,b;map<string,int>mp;strings;for(inti=0;i<n;i++){cin>>s;if(mp[s]==0){mp[s]=1;a.push_back(s);}}mp.clear();for(inti=0;i<m;i++){cin>>s;if(mp[s]==0){mp[s]=1;b.push_back...
#include<cstdio>#include<iostream>#include<string>#include#include<vector>#include<utility>#include<set>#include<algorithm>#defineRI register int#defineCI const int&usingnamespacestd;typedefpair <int,int> pi;intn,m,rk; set <string> s1,s2; string s; map <string,pi> rst;vector <pair <pi...
»The 2023 ICPC Asia Nanjing Regional Contest / The 2nd Universal Cup. Stage 11: Nanjing 作者:MiniLong 出处:http://www.cnblogs.com/MiniLong/ --- 有问题找我哦,如果点击按钮失效,就直接向QQ:2729806415发送消息 <2024年12月> 日一二三四五六 1234567 891011121314 15161718192021...
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,只是普通的读入,后来才发现就是
dfs传入pos,cnt1,cnt0,limit,lead分别表示当前位,cnt1和cnt0表示1的个数和后缀0的个数。带上记忆化,dfs如下: int&v=f[pos][cnt1][cnt0][lead];if(!limit&&~v)returnv;// 记忆化if(!pos)return(cnt1&&cnt1==cnt0);// 找到特殊数int up=limit?nums[pos]:1,res=0;res+=dfs(pos-1,cnt1,...
Just a few hours ago, The 2021 ICPC Asia Regionals Online Contest (I) was held on https://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 ...
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...
k个节点(编号0~k-1),n个工作请求(编号i:0~n-1),每个请求给出到达时间和持续时间,每个请求会优先寻找编号i%k的节点,若节点忙碌则依次往下,节点在处理完某个节点前处于忙碌状态。 要求找出最忙碌的节点(接受请求最多的节点)。 数据: k/n<=1e5;time<=1e9 ...