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 ...
随机推荐
- vim 查找时忽略大小写
:set ic 忽略大小写#ignorecase :set noic 不忽略大小写#noignorecase
- yum install 安装 下载好的rpm包 会并依赖包一起安装 zoom电话会议的安装
[root@ok-T Downloads]# rpm -ivh zoom_x86_64.rpm error: Failed dependencies: libxcb-image.so.()(64bit ...
- openfire 服务器名称:后面的黄色叹号
然后点击重新获取证书,然后重新启动服务,问题解决!
- 【转载】Python编写简易木马程序
转载来自: http://drops.wooyun.org/papers/4751?utm_source=tuicool 使用Python编写一个具有键盘记录.截屏以及通信功能的简易木马. 首先准备好 ...
- HTML+CSS页面滚动效果处理
HTML+CSS代码如下: <!doctype html> <html> <head> <meta charset="utf-8"> ...
- Spring XML配置文件示例(二)——web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" ...
- .NET NLog 详解(二)
Git是个很好的源码管理系统,你可以瞬间切换为任何历史版本.为了更好的解析NLog这个组件,我们将时钟倒拨回2004年.(注意:NLog v0.9 has been released 是在2005-0 ...
- struct和typedef struct
转自:http://www.cnblogs.com/qyaizs/articles/2039101.html struct和typedef struct 分三块来讲述: 1 首先://注意在C和C++ ...
- Eclipse 快捷键 自动生成get/set注释(转)
Alt+Shit+S Generaet Getter and Setter 选中Generate method comments 文本编辑 复制行 Ctrl+Alt+向下键 编辑文本 快捷键:选中接 ...
- MFC GDI绘图基础
一.关于GDI的基本概念 什么是GDI? Windows绘图的实质就是利用Windows提供的图形设备接口GDI(Graphics Device Interface)将图形绘制在显示器上. 在Wind ...