Submission #861187

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8611872023-10-15 15:19:18qwushaPortals (BOI14_portals)C++17
100 / 100
897 ms214812 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fi first
#define se second
typedef long double ld;
const ll inf = 1e9;
const ld eps = 1e-8;
struct vert{
int fir, sec, we;
};
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
int stai, staj, fini, finj;
vector<vector<char>> a(n, vector<char>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a[i][j];
if (a[i][j] == 'S') {
stai = i;
staj = j;
} else if (a[i][j] == 'C') {
fini = i;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

portals.cpp: In function 'int main()':
portals.cpp:86:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |             for (int qw = 0; qw < steni[i][j].size(); qw++) {
      |                              ~~~^~~~~~~~~~~~~~~~~~~~
portals.cpp:93:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   93 |             for (int qw = 0; qw < steni[i][j].size(); qw++) {
      |                              ~~~^~~~~~~~~~~~~~~~~~~~
portals.cpp:117:28: warning: 'finj' may be used uninitialized in this function [-Wmaybe-uninitialized]
  117 |     cout << dist[fini][finj] << '\n';
      |                            ^
portals.cpp:117:22: warning: 'fini' may be used uninitialized in this function [-Wmaybe-uninitialized]
  117 |     cout << dist[fini][finj] << '\n';
      |                      ^
portals.cpp:102:20: warning: 'staj' may be used uninitialized in this function [-Wmaybe-uninitialized]
  102 |     dist[stai][staj] = 0;
      |                    ^
portals.cpp:102:14: warning: 'stai' may be used uninitialized in this function [-Wmaybe-uninitialized]
  102 |     dist[stai][staj] = 0;
      |              ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...