Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma optimization_level 3
- #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
- #include <stdio.h>
- #include <iostream>
- #include <algorithm>
- #include <fstream>
- #include <vector>
- #include <queue>
- #include <functional>
- #include <set>
- #include <map>
- #include <math.h>
- #include <cmath>
- #include <string>
- #include <time.h>
- #include <random>
- #include <unordered_set>
- #include <unordered_map>
- #include <bitset>
- #include <string.h>
- using namespace std;
- #define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
- #define cin in
- #define cout out
- #define pii pair<int,int>
- #define ll long long
- #define db double
- #define ld long double
- #define uset unordered_set
- #define umap unordered_map
- #define F first
- #define S second
- #define vec vector
- #define ms multiset
- #define pb push_back
- #define pll pair<ll,ll>
- #define pdd pair<ld, ld>
- #define pq priority_queue
- #define umap unordered_map
- #define uset unordered_set
- #define pii pair<int, int>
- #define pnn pair<Node*, Node*>
- #define uid uniform_int_distribution
- ifstream in("input.txt");
- ofstream out("output.txt");
- int n, m;
- //-1 : empty cell, 0 - normal ship, 1 - damaged ship
- vector<vector<int>> field;
- vector<vector<bool>> used;
- void input() {
- cin >> n >> m;
- field.resize(n, vector<int>(m));
- for (int i = 0; i < n; i++) {
- string s;
- cin >> s;
- for (int j = 0; j < m; j++) {
- char cur = s[j];
- int& t = field[i][j];
- if (cur == '-')
- t = -1;
- else if (cur == 'S')
- t = 0;
- else
- t = 1;
- }
- }
- }
- int main()
- {
- input();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement