Submission #1099635

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10996352024-10-11 21:08:11stomic07Portals (BOI14_portals)C++17
70 / 100
1051 ms26180 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 1002;
int dozida[N][N];
int bio[N][N];
int ubacen[N][N];
int xmov[4] = {0, 1, 0, -1};
int ymov[4] = {-1, 0, 1, 0};
void reset(){
for (int i=0; i<N; ++i){
for (int j=0; j<N; ++j){
dozida[i][j] = -1;
bio[i][j] = -1;
ubacen[i][j] = -1;
}
}
}
void bfs_odzida(const vector<string>& v, vector<pair<int, int>>& fronta){
vector<pair<int, int>> novi;
for (int step = 0; !fronta.empty(); ++step){
novi.clear();
for (int i=0; i<fronta.size(); ++i){
pair<int, int> curr = fronta[i];
if (dozida[curr.first][curr.second] != -1) continue;
dozida[curr.first][curr.second] = step;
for (int j=0; j<4; ++j){
int y = curr.first + ymov[j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

portals.cpp: In function 'void bfs_odzida(const std::vector<std::__cxx11::basic_string<char> >&, std::vector<std::pair<int, int> >&)':
portals.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   for (int i=0; i<fronta.size(); ++i){
      |                 ~^~~~~~~~~~~~~~
portals.cpp: In function 'void dijkstra(const std::vector<std::__cxx11::basic_string<char> >&, const std::pair<int, int>&, const std::pair<int, int>&)':
portals.cpp:80:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |   for (int i=0; i<krajevi.size(); ++i){
      |                 ~^~~~~~~~~~~~~~~
portals.cpp: In function 'int main()':
portals.cpp:106:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |   for (int j=0; j<s.size(); ++j){
      |                 ~^~~~~~~~~
#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...