当前位置: 首页 > news >正文

食品公司网站设计项目济阳做网站哪家好

食品公司网站设计项目,济阳做网站哪家好,个人网站推荐免费,合肥培训网站推广Mirrored String II 看到题解说是马拉车算法#xff0c;我赛时并没想到#xff08;好吧其实我是比赛完才知道有马拉车这个算法#xff09; 因为字符串的长度只有1000#xff0c;直接暴力跑其实就可以了#xff0c;但是要注意的是#xff1b;回文串有俩种形式#xff0c…Mirrored String II 看到题解说是马拉车算法我赛时并没想到好吧其实我是比赛完才知道有马拉车这个算法 因为字符串的长度只有1000直接暴力跑其实就可以了但是要注意的是回文串有俩种形式一种是aba的另一种是baab的形式这是需要注意的地方 //#pragma GCC optimize(3) //O2优化开启 #includeiostream #includecmath #includecstring #includecstdio #includestack #includestring #includealgorithm //#includeunordered_map #includemap #includebitset #includecstring //#include unordered_set //#includepriority_queue #includequeue #includedeque #includeset #includestdlib.h #define dbug cout*****hear*****endl; #define rep(a,b,c) for(ll ab;ac;a) #define per(a,b,c) for(ll ab;ac;a--) #define no coutNoendl; #define yes coutYesendl; //#define endl \n//交互题一定要关 #define lowbit(x) (x-x) #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); //priority_queueint,vectorint,greaterint q; using namespace std; typedef long long ll; typedef long double ld; typedef pairll, ll PII; typedef pairlong double, long double PDD; ll INF 0x3f3f3f3f; //const ll LINFLLONG_MAX; // int get_len(int x1,int y1,int x2,int y2) // { // return (x2-x1)*(x2-x1) (y2-y1)*(y2-y1); // } const ll N 2e5 10; const ll mod1 998244353; const ll mod2 1e9 7; const ll hash_num 3e9 9; ll n, m, ca; ll arr[N], brr[N], crr[N], drr[N]; //ll h[N],ne[N],e[N],w[N],book[N],idx; // void add(ll a, ll b , ll c) // { // e[idx] b, w[idx] c,ne[idx] h[a], h[a] idx ; // } vectorllve[N]; bool check(char x) {if (xA||x H || x I || x M || x O || x T || x U || x V || x W || x X || x Y)return 1;return 0; } void solve() {string s;cin s;ll len s.size();rep(i, 0, len){arr[i] 0, brr[i] 0;}rep(i, 0, len - 1){if (check(s[i])){arr[i] 1;ll l i - 1;ll r i 1;while (l 0 r len){if (check(s[l]) s[r] s[l]){l--;r;arr[i] 2;}else{break;}}if (check(s[i1] ) s[i] s[i 1]){brr[i] 2;ll l i - 1;ll r i 2;while (l 0 r len){if (check(s[l]) s[r] s[l]){l--;r;brr[i] 2;}else{break;}}}}}sort(arr, arr len);sort(brr, brr len);cout max(arr[len - 1], brr[len - 1]) endl;; }int main() {IOS;ll _;_ 1; //scanf(%lld,_);cin _;ca 1;while (_--){solve();ca;}return 0; }Competitive Seagulls 这是一个博弈废话大家叫这种博弈为对称博弈 本题对称 博弈的特性如下 对于给定的长度n我们可以先取中间的一段使左右两边的白色方格一样多这样后手取其中一边我们就可以在另一边取和他相同的长度这样我们是必赢的,因为不管奇数还是偶数个我们可以取2或3使左右两边相等。但是对于2和3不同只有这两种情况我们是先手必输的。 void solve() {cin n;if(n2 || n3){cout second endl;}else{cout first endl;} } Hey JUDgE 每次输入的长度只有7个而比赛需要的题目数量是5所以最多只能组合俩次题目又因为题目不能重复利用新得到的题目也无法再次组合所以就直接枚举就可以找到答案 //#pragma GCC optimize(3) //O2优化开启 #includeiostream #includecmath #includecstring #includecstdio #includestack #includestring #includealgorithm //#includeunordered_map #includemap #includebitset #includecstring //#include unordered_set //#includepriority_queue #includequeue #includedeque #includeset #includestdlib.h #define dbug cout*****hear*****endl; #define rep(a,b,c) for(ll ab;ac;a) #define per(a,b,c) for(ll ab;ac;a--) #define no coutNoendl; #define yes coutYesendl; //#define endl \n//交互题一定要关 #define lowbit(x) (x-x) #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); //priority_queueint,vectorint,greaterint q; using namespace std; typedef long long ll; typedef long double ld; typedef pairll, ll PII; typedef pairlong double, long double PDD; ll INF 0x3f3f3f3f; //const ll LINFLLONG_MAX; // int get_len(int x1,int y1,int x2,int y2) // { // return (x2-x1)*(x2-x1) (y2-y1)*(y2-y1); // } const ll N 2e5 10; const ll mod1 998244353; const ll mod2 1e9 7; const ll hash_num 3e9 9; ll n, m, ca; ll arr[N], brr[N], crr[N], drr[N]; //ll h[N],ne[N],e[N],w[N],book[N],idx; // void add(ll a, ll b , ll c) // { // e[idx] b, w[idx] c,ne[idx] h[a], h[a] idx ; // } ll book[N]; ll get_hard(char a) {brr[A] 1;brr[B] 2;brr[C] 3;brr[D] 4;brr[E] 5;return brr[a]; } void solve() {string s;cin s;mapll, llmp;rep(i, 0, s.size() - 1){mp[get_hard(s[i])] ;arr[i 1] get_hard(s[i]);}ll num 0;rep(i, 1, 5){// cout arr[i] ;if (!mp[i])num;}if (num 0){cout YES endl;return;}ll xx;ll yy 0;rep(i, 1, 7){rep(j, i 1, 7){xx 1;mp[arr[i]]--, mp[arr[j]]--, mp[arr[i] arr[j]];rep(k, 1, 5){if (!mp[k])xx 0;}mp[arr[i]], mp[arr[j]], mp[arr[i] arr[j]]--;if (xx 1)yy 1;}}if (!yy){rep(i, 1, 7){rep(j, i 1, 7){rep(k, 1, 7){rep(l, k 1, 7){xx 1;if (i k || j l || i l || j k)continue;mp[arr[i]]--, mp[arr[j]]--, mp[arr[i] arr[j]];mp[arr[k]]--, mp[arr[l]]--, mp[arr[k] arr[l]];rep(mm, 1, 5){if (!mp[mm])xx 0;}mp[arr[i]], mp[arr[j]], mp[arr[i] arr[j]]--;mp[arr[k]], mp[arr[l]], mp[arr[k] arr[l]]--;if (xx 1){// cout i j k l endl;yy 1;}}}}}}if (yy){cout YES endl;}else{cout NO endl;} }int main() {IOS;ll _;_ 1; //scanf(%lld,_);cin _;ca 1;while (_--){solve();ca;}return 0; }Smooth Developer 很水的一个模拟但是诶您没猜到吧我从开始接触到正式ac前后跨了4h。 唯一需要注意的就是所需要的函数要全部标记完之后再输出而不是有一个输出一个 //#pragma GCC optimize(3) //O2优化开启 #includeiostream #includecmath #includecstring #includecstdio #includestack #includestring #includealgorithm //#includeunordered_map #includemap #includebitset #includecstring //#include unordered_set //#includepriority_queue #includequeue #includedeque #includeset #includestdlib.h #define dbug cout*****hear*****endl; #define rep(a,b,c) for(ll ab;ac;a) #define per(a,b,c) for(ll ab;ac;a--) #define no coutNoendl; #define yes coutYesendl; //#define endl \n//交互题一定要关 #define lowbit(x) (x-x) #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); //priority_queueint,vectorint,greaterint q; using namespace std; typedef long long ll; typedef long double ld; typedef pairll, ll PII; typedef pairlong double, long double PDD; ll INF 0x3f3f3f3f; //const ll LINFLLONG_MAX; // int get_len(int x1,int y1,int x2,int y2) // { // return (x2-x1)*(x2-x1) (y2-y1)*(y2-y1); // } const ll N 2e5 10; const ll mod1 998244353; const ll mod2 1e9 7; const ll hash_num 3e9 9; ll n, m, ca; ll arr[N], brr[N], crr[N], drr[N]; //ll h[N],ne[N],e[N],w[N],book[N],idx; // void add(ll a, ll b , ll c) // { // e[idx] b, w[idx] c,ne[idx] h[a], h[a] idx ; // } mapstring, llmp; vectorllve[N]; char x[30], s[N][30]; ll book[N]; void dfs(ll u) {book[u] 1;for (auto it : ve[u]){if (book[it])continue;dfs(it);}}void solve() {scanf(%lld%lld, n, m);rep(i, 1, n)ve[i].clear();mp.clear();rep(i, 1, n){scanf(%s, s[i]);mp[s[i]] i;ll num;scanf(%lld, num);rep(j, 1, num){scanf(%s, x);if (mp[x] ! i){ve[i].push_back(mp[x]);}}}memset(book, 0, sizeof book);while (m--){scanf(%s, x);if(!book[mp[x]])dfs(mp[x]);}rep(i, 1, n){if (book[i]){printf(%s\n, s[i]);}} }int main() {//IOS;ll _;_ 1; scanf(%lld, _);//cin _;ca 1;while (_--){solve();ca;}return 0; }ACPC Headquarters : AASTMT (Stairway to Heaven) 换个想法我们不抓着比赛名称看我们就抓着志愿者看数据很小只有365当得知一个志愿者有需要参加的比赛的时候就遍历一遍是否有矛盾的存在矛盾的储存下来就OK了 //#pragma GCC optimize(3) //O2优化开启 #includeiostream #includecmath #includecstring #includecstdio #includestack #includestring #includealgorithm //#includeunordered_map #includemap #includebitset #includecstring //#include unordered_set //#includepriority_queue #includequeue #includedeque #includeset #includestdlib.h #define dbug cout*****hear*****endl; #define rep(a,b,c) for(ll ab;ac;a) #define per(a,b,c) for(ll ab;ac;a--) #define no coutNoendl; #define yes coutYesendl; //#define endl \n//交互题一定要关 #define lowbit(x) (x-x) #define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); //priority_queueint,vectorint,greaterint q; using namespace std; typedef long long ll; typedef long double ld; typedef pairll, ll PII; typedef pairlong double, long double PDD; ll INF 0x3f3f3f3f; //const ll LINFLLONG_MAX; // int get_len(int x1,int y1,int x2,int y2) // { // return (x2-x1)*(x2-x1) (y2-y1)*(y2-y1); // } const ll N 2e5 10; const ll mod1 998244353; const ll mod2 1e9 7; const ll hash_num 3e9 9; ll n, m, ca; ll arr[N], brr[N], crr[N], drr[N]; //ll h[N],ne[N],e[N],w[N],book[N],idx; // void add(ll a, ll b , ll c) // { // e[idx] b, w[idx] c,ne[idx] h[a], h[a] idx ; // }map string, vectorPIImp;setstring se; void solve() {cin n;mp.clear();se.clear();rep(i, 1, n){string name;ll l, r, num;cin name l r num;rep(j, 1, num){string pename;cin pename;for (ll k 0;k mp[pename].size();k){if (mp[pename][k].first l l mp[pename][k].second){se.insert(pename);}else if (mp[pename][k].first r mp[pename][k].second r){se.insert(pename);}else if (l mp[pename][k].first r mp[pename][k].second){se.insert(pename);}}mp[pename].push_back({ l,r });}}cout se.size() endl;for (auto it : se){cout it endl;} }int main() {IOS;ll _;_ 1; //scanf(%lld,_);cin _;ca 1;while (_--){solve();ca;}return 0; }
http://www.pierceye.com/news/611191/

相关文章:

  • 网站开发类型什么意思网页制作与设计千年之恋代码
  • 怎么做公司的网站免费网站建设专业的公司
  • 适合这手机浏览器主页的网站wordpress本地上传服务器
  • 济南百度网站开发寮步镇做网站
  • 营销类型的公司网站专注高密做网站哪家好
  • 公司网站建设找谁做网络渠道
  • 网站建设公司 校园网站html5商城网站
  • 自学it做网站厦门网站推广¥做下拉去118cr
  • 汕头市做网站优化国内时事新闻
  • 网站文章来源seowordpress 搜索 分词
  • 网站建设和网络推广微信开发品牌
  • 湛江网站关键词优化百度推广优化技巧
  • 做盗版网站会怎样网页设计规范2018
  • 做个中英文网站多少钱网页设计图片作品
  • iis7 添加php网站网站为什么需要空间
  • 网站到首页排名h5怎么制作的
  • 网站制作教程 pdf下载培训网站制作网站
  • 网站开发文档范例国外服务器租用价格表
  • 六安网站制作费用怎么做百度提交入口网站
  • centos7做网站做pc端网站讯息
  • 驻马店建设网站安徽全过程网站搭建案例
  • 企业网站推广费用wordpress相册汉化版
  • 怎么做正规网站广告网站设计怎么样
  • 深圳营销型网站公司电话云渲染网站开发
  • 生成网站有吗免费的网站建设服务有哪些内容
  • 网站建设制作公司思企互联超级采购小程序怎么注册
  • 燕郊做网站找谁wordpress登录修改
  • 大概开发一个网站多少钱php做网站商城系统怎么样
  • wordpress网站程序员登录百度账号
  • wordpress trac网站优化公司哪家好