Submission #730580

#TimeUsernameProblemLanguageResultExecution timeMemory
730580AtabayRajabliAwesome Arrowland Adventure (eJOI19_adventure)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define pb push_back #define pii pair<int, int> #define pll pair<ll, ll> #define MAX 5e4 + 1 #define all(v) v.begin(), v.end() #define sz(v) v.size() #define INF 0x3F3F3F3F3F3F3F3FLL #define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define sec second #define fi first typedef long long ll; typedef unsigned long long ull; using namespace std; int d[501][501], g[501][501], n; int v[4] = {1, 0, 0, -1}; int f[4] = {0, -1, 1, 0}; void dijkstra(int x, int y) { d[x][y] = 0; priority_queue<pair<int, pii>, vector<pair<int, pii>>, greater<pair<int, pii>>>> q; q.push({x, {y, g[x][y]}}); while(!q.empty()) { int a, b, w; a = q.top().fi; b = q.top().sec.fi; w = q.top().sec.sec; } } void $() { int n, m; cin >> n >> m; for(int i = 0; i<501; i++) { for(int j = 0; j<501; j++) { d[i][j] = INF; } } for(int i = 1 ; i<=n; i++) { for(int j = 1; j<=m; j++) { char c; int k; cin >> c; if(c == 'N')k = 1; if(c == 'E')k = 2; if(c == 'S')k = 3; if(c == 'W')k = 4; g[i][j] = k; } } } int main() { OPT int t = 1; while(t--) $(); }

Compilation message (stderr)

adventure.cpp: In function 'void dijkstra(int, int)':
adventure.cpp:26:83: error: expected unqualified-id before '>' token
   26 |     priority_queue<pair<int, pii>, vector<pair<int, pii>>, greater<pair<int, pii>>>> q;
      |                                                                                   ^~
adventure.cpp:27:5: error: 'q' was not declared in this scope
   27 |     q.push({x, {y, g[x][y]}});
      |     ^
adventure.cpp: In function 'void $()':
adventure.cpp:8:13: warning: overflow in conversion from 'long long int' to 'int' changes value from '4557430888798830399' to '1061109567' [-Woverflow]
    8 | #define INF 0x3F3F3F3F3F3F3F3FLL
      |             ^~~~~~~~~~~~~~~~~~~~
adventure.cpp:49:23: note: in expansion of macro 'INF'
   49 |             d[i][j] = INF;
      |                       ^~~