#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的更多相关文章

  1. codeforces round #234B(DIV2) C Inna and Huge Candy Matrix

    #include <iostream> #include <vector> #include <algorithm> #include <utility> ...

  2. codeforces round #234B(DIV2) A Inna and Choose Options

    #include <iostream> #include <string> #include <vector> using namespace std; ; ,,, ...

  3. Codeforces Round #539 div2

    Codeforces Round #539 div2 abstract I 离散化三连 sort(pos.begin(), pos.end()); pos.erase(unique(pos.begin ...

  4. 【前行】◇第3站◇ Codeforces Round #512 Div2

    [第3站]Codeforces Round #512 Div2 第三题莫名卡半天……一堆细节没处理,改一个发现还有一个……然后就炸了,罚了一啪啦时间 Rating又掉了……但是没什么,比上一次好多了: ...

  5. Codeforces Round#320 Div2 解题报告

    Codeforces Round#320 Div2 先做个标题党,骗骗访问量,结束后再来写咯. codeforces 579A Raising Bacteria codeforces 579B Fin ...

  6. Codeforces Round #564(div2)

    Codeforces Round #564(div2) 本来以为是送分场,结果成了送命场. 菜是原罪 A SB题,上来读不懂题就交WA了一发,代码就不粘了 B 简单构造 很明显,\(n*n\)的矩阵可 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. Clr Via C#读书笔记---垃圾回收机制

    #1 垃圾回收平台的基本工作原理: 访问一个资源所需的具体步骤: 1)调用IL指令newobj,为代表资源的类型分配内存.在C#中使用new操作符,编译器就会自动生成该指令.2)初始化内存,设置资源的 ...

  2. Python 与 C# lambda表达式比较

    Python里到lambda表达式非常简约, lam =lambda a: a*2 --> lam(3) 6 在某些情况下确实挺好用到.但是相比C#到lambda表达式,还是不够强大(我不是在黑 ...

  3. 设计工具 -uml

  4. 驱动中获取PsActiveProcessHead变量地址的五种方法也可以获取KdpDebuggerDataListHead

    PsActiveProcessHead的定义: 在windows系统中,所有的活动进程都是连在一起的,构成一个双链表,表头是全局变量PsActiveProcessHead,当一个进程被创建时,其Act ...

  5. 数据库ORM框架GreenDao

    常用的数据库: 1). Sql Server2). Access3). Oracle4). Sysbase5). MySql6). Informix7). FoxPro8). PostgreSQL9) ...

  6. Fragment实现兼容手机和平板

    Android手机的设置界面,点击一下Sound,可以跳转到声音设置界面,如下面两张图所示:             然后再来看一下Android Pad的设置界面,主设置页面和声音设置页面都是在一个 ...

  7. 生成n位随机字符串

    --1.借助newid() Go --创建视图(因为在函数中无法直接使用newid()) create view vnewid as select newid() N'MacoId'; go --创建 ...

  8. Chrome浏览器之 Postman 安装

    Postman 是一款发送 HTTP 请求的 Chrome 插件.开发后端程序的同学可以用它来测试自己写的应用程序是否能够正常访问. 现在由于国内的网络限制, Chrome 浏览器里无法访问“扩展程序 ...

  9. mysql数据库管理工具sqlyog在首选项里可以设置默认查询分页条数和字体,改写关键字大小写

    sqlyog设置一直习惯用sqlyog来管理mysql数据库,但有三个地方用得不是很爽:1.默认查询条数只有1000条经常需要勾选掉重新查询.2.自动替换关键字大小写,有时候字段名为关键字的搞成大写的 ...

  10. JavaScript设计模式——前奏(封装和信息隐藏)

    前面一篇讲了js设计模式的前奏,包括接口的讲解.. 三:封装和信息隐藏: 信息隐藏用来进行解耦,定义一些私有的数据和方法. 封装是用来实现信息隐藏的技术,通过闭包实现私有数据的定义和使用. 接口在这其 ...