codeforces round #234B(DIV2) B Inna and New Matrix of Candies
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set> using namespace std; int main(){
int n,m;
cin >> n >> m;
set<int> distance;
bool flag = true;
for(int i = ; i < n; ++ i){
string rectangle;
cin >> rectangle;
int dwarf_pos = rectangle.find('G');
int candy_pos = rectangle.find('S');
int dist = candy_pos - dwarf_pos;
if(dist > ) distance.insert(dist);
else flag = false;
}
if(!flag) cout<<-<<endl;
else cout<<distance.size()<<endl;
return ;
}
codeforces round #234B(DIV2) B Inna and New Matrix of Candies的更多相关文章
- codeforces round #234B(DIV2) C Inna and Huge Candy Matrix
#include <iostream> #include <vector> #include <algorithm> #include <utility> ...
- codeforces round #234B(DIV2) A Inna and Choose Options
#include <iostream> #include <string> #include <vector> using namespace std; ; ,,, ...
- Codeforces Round #539 div2
Codeforces Round #539 div2 abstract I 离散化三连 sort(pos.begin(), pos.end()); pos.erase(unique(pos.begin ...
- 【前行】◇第3站◇ Codeforces Round #512 Div2
[第3站]Codeforces Round #512 Div2 第三题莫名卡半天……一堆细节没处理,改一个发现还有一个……然后就炸了,罚了一啪啦时间 Rating又掉了……但是没什么,比上一次好多了: ...
- Codeforces Round#320 Div2 解题报告
Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Fin ...
- Codeforces Round #564(div2)
Codeforces Round #564(div2) 本来以为是送分场,结果成了送命场. 菜是原罪 A SB题,上来读不懂题就交WA了一发,代码就不粘了 B 简单构造 很明显,\(n*n\)的矩阵可 ...
- Codeforces Round #234 (Div. 2) B. Inna and New Matrix of Candies
B. Inna and New Matrix of Candies time limit per test 1 second memory limit per test 256 megabytes i ...
- Codeforces Round #234 (Div. 2) B. Inna and New Matrix of Candies SET的妙用
B. Inna and New Matrix of Candies time limit per test 1 second memory limit per test 256 megabytes i ...
- Codeforces Round #234 (Div. 2):B. Inna and New Matrix of Candies
B. Inna and New Matrix of Candies time limit per test 1 second memory limit per test 256 megabytes i ...
随机推荐
- PHP define()的用法
define()函数理解1(着重于作用的理解) define() 函数定义一个常量. 常量的特点: 常量类似变量,不同之处在于:在设定以后,常量的值无法更改常量名,不需要开头的美元符号 ($),作用域 ...
- My97DatePicker使用技巧
My97DatePicker使用是很常用的控件,总结一下常用使用技巧: 1.onpicked是事件,也就选择日期之后触发事件: 2.isShowClear:是否显示清理按钮: 3.maxDate:最大 ...
- js正则表达式:验证邮箱格式、密码复杂度、手机号码、QQ号码
直接上代码 Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ...
- linux环境下libevent的使用
step1:安装libevent yum install libevent step2: 代码入下: #include <sys/socket.h> #include <sys/ty ...
- 5-04用Sql语句创建表
用Sql语句创建表的基本语法: USE E_Market--指向当前所操作的数据库 GO CREATE TABLE CommoditySort--创建表的名字 { sortID int IDENTIT ...
- 提高WPF程序性能的几条建议
这篇博客将介绍一些提高WPF程序的建议(水平有限,如果建议有误,请指正.) 1. 加快WPF程序的启动速度: (1).减少需要显示的元素数量,去除不需要或者冗余的XAML元素代码. (2).使用UI虚 ...
- HDU 5145 NPY and girls 莫队+逆元
NPY and girls Problem Description NPY's girlfriend blew him out!His honey doesn't love him any more! ...
- SQL Server 创建表 添加主键 添加列常用SQL语句
--删除主键 alter table 表名 drop constraint 主键名 --添加主键 alter table 表名 add constraint 主键名 primary key(字段名1, ...
- Linux解压文件
zip: 解压:unzip filename 解压到tmp文件夹:unzip filename.zip -d /tmp 查看压缩文件而不解压:unzip filename.zip -v tar.gz: ...
- JavaScript入门(2)
encodeURI()和 decodeURI()作用 编码与解码 encodeURIComponent()和 decodeURIComponent()作用区别是 后者可以处理一些特殊字符进行转义 ...