日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

2019牛客暑期多校训练营(第八场)G Gemstones(模拟)

發布時間:2024/4/15 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 2019牛客暑期多校训练营(第八场)G Gemstones(模拟) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

鏈接:https://ac.nowcoder.com/acm/contest/888/G
來源:??途W

題目描述

Gromah and LZR have entered the seventh level. There are a sequence of gemstones on the wall.
After some tries, Gromah discovers that one can take exactly three successive gemstones with the same types away from the gemstone sequence each time, after taking away three gemstones, the left two parts of origin sequence will be merged to one sequence in origin order automatically.
For example, as for "ATCCCTTG", we can take three 'C's away with two parts "AT", "TTG" left, then the two parts will be merged to "ATTTG", and we can take three 'T's next time.
The password of this level is the maximum possible times to take gemstones from origin sequence.
Please help them to determine the maximum times.

輸入描述:

Only one line containing a string ss_{}s?, denoting the gemstone sequence, where the same letters are regarded as the same types. 1≤∣s∣≤1051 \le |s| \le 10^51s105 ss_{}s? only contains uppercase letters.

輸出描述:

Print a non-negative integer in a single line, denoting the maximum times. 示例1

輸入

復制 ATCCCTTG

輸出

復制 2

說明

One possible way is that ‘‘ATCCCTTG?"??→??‘‘ATTTG?"??→‘‘AG?"``ATCCCTTG\," \; \rightarrow \; ``ATTTG\," \; \rightarrow ``AG\,"ATCCCTTG"ATTTG"AG". #include <cstdio> #include <iostream> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <queue> #include <vector> #include <map> using namespace std;#define ll long long #define eps 1e-9string s; int sign[100000 + 8], num[100000 + 8];int main() {ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin>>s;int len = s.size();int id = 0;int ans = 0;memset(num, 0, sizeof(num));for(int i = 0; i < len; i++){if(!i){sign[id] = s[i];num[id]++;}else{if(s[i] == sign[id]){num[id]++;if(num[id] == 3){num[id] = 0;id--;ans++;}}else{sign[++id] = s[i];num[id]++;}}}cout << ans << '\n';return 0; }

?

轉載于:https://www.cnblogs.com/RootVount/p/11368600.html

總結

以上是生活随笔為你收集整理的2019牛客暑期多校训练营(第八场)G Gemstones(模拟)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 三年中文在线观看中文版 | 伊人伊人伊人 | 久久久精品免费 | 好看的中文字幕av | 久久不射电影网 | a黄视频| 少妇的被肉日常np | 黄av网站| 美女被揉胸视频 | 免费高清黄色 | 亚洲午夜精品久久久 | 免费av片| av日韩在线播放 | 欧美精品日韩少妇 | 午夜视频在线观看一区二区 | 久久久久久av无码免费网站下载 | 日韩av不卡电影 | 欧美久久久久久久久 | www.蜜臀| ass亚洲尤物裸体pics | 黄色片18 | 成人漫画网站 | 国产成人自拍一区 | 免费欧美一级 | 99精品乱码国产在线观看 | 国产精品国产三级国产普通话蜜臀 | 国产一区二区三区欧美 | 日日操av| 激情深爱五月 | 午夜影院欧美 | 男女偷爱性视频刺激 | 91视频在线免费 | 欧美综合色 | 晨勃顶到尿h1v1 | 成人在线日韩 | 欧美日韩一区二区三区在线 | 今天高清视频在线观看视频 | av永久免费在线观看 | 成年人免费视频网站 | 9色av| 波多野结衣一区二区 | 西西毛片| 欧美一级片在线播放 | 3d动漫精品啪啪一区二区竹菊 | 中文字幕xxxx | 麻豆传媒在线视频 | 疯狂做爰高潮videossex | 中文字幕日韩在线播放 | 国产成人在线精品 | 99色视频| 精品久久国产字幕高潮 | 国产伦精品一区二区三区高清版 | 国产一区二区三区免费看 | 久久青青操 | 国产成人欧美一区二区三区91 | www.精品视频 | 欧美性视频在线播放 | www色视频 | 疯狂揉花蒂控制高潮h | 国产成人免费在线观看 | 日韩av图片 | 手机在线观看免费av | 91官网视频| 美色视频 | 丁香花电影高清在线阅读免费 | 国产一区一区 | 欧美一区免费观看 | 欧美亚洲在线视频 | 99ri国产在线 | 给我看免费高清在线观看 | 深夜福利国产 | 久久久久中文字幕 | 精品一区在线看 | 久久香蕉av | www.看毛片| 欧美videossex极品 | 91麻豆精品国产午夜天堂 | 天堂俺去俺来也www久久婷婷 | 欧美激情国产日韩精品一区18 | 探花系列在线观看 | 主播福利在线 | 草青青视频 | 91精品人妻一区二区三区果冻 | 亚洲美女高潮久久久 | 9999免费视频 | 国偷自产视频一区二区久 | 久久er99热精品一区二区介绍 | 亚洲精品在线中文字幕 | caopeng视频 | 密臀久久 | 琪琪色视频 | 亚洲国产系列 | 波多野结衣大片 | 国产的av| 亚洲综合自拍 | 国产精品亚洲天堂 | 午夜激情免费视频 | 欧美日韩网址 | 天天操天天操天天操天天操天天操 |