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 ;
}
上一篇:跟着百度学PHP[4]OOP面对对象编程-10-静态关键字static


下一篇:PHP漏洞全解(六)-跨网站请求伪造