제출 #369883

#제출 시각아이디문제언어결과실행 시간메모리
369883AA_Surely새로운 문제 (POI13_mor)C++14
30 / 100
2226 ms117812 KiB
#include <iostream> #include <vector> #include <queue> #include <algorithm> #include <cmath> #define FOR(i,x,n) for(int i=x; i<n; i++) #define F0R(i,n) FOR(i,0,n) #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0) #define F first #define S second #define pb push_back #define FILL(a, b) memset(a, b, sizeof(a)); using namespace std; typedef long long LL; typedef pair<int, int> PII; typedef vector<int> VI; const int MAXN = 5000+2; short int INF = 31111; int n, m, k, u, v, to, st, fn, len; VI adj[MAXN]; short int fastest_route[MAXN][MAXN][2]; void Input() { cin >> n >> m >> k; F0R (i, n) F0R (j, n) fastest_route[i][j][0] = fastest_route[i][j][1] = INF; F0R (i, m) { cin >> u >> v; adj[--u].pb(--v); adj[v].pb(u); } } void Bfs(int now_on) { queue <PII> keep; PII add, on; keep.push({now_on, 0}); while (!keep.empty()) { on = keep.front(); keep.pop(); on.S++; F0R (i, adj[on.F].size()) { to = adj[on.F][i]; if (fastest_route[now_on][to][on.S & 1] > on.S) { fastest_route[now_on][to][on.S & 1] = on.S; keep.push({to, on.S}); } } } return; } int main() { IOS; Input(); F0R (i, n) Bfs(i); /* F0R (i, 8) { F0R (j, 8) cout << fastest_route[i][j][0] << "/" << fastest_route[i][j][1] << ' '; cout << endl; } // **/ F0R (i, k) { cin >> st >> fn >> len; if (fastest_route[st - 1][fn - 1][len & 1] <= len) cout << "TAK\n"; else cout << "NIE\n"; } }

컴파일 시 표준 에러 (stderr) 메시지

mor.cpp: In function 'void Bfs(int)':
mor.cpp:7:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 | #define FOR(i,x,n) for(int i=x; i<n; i++)
      |                                  ^
mor.cpp:8:18: note: in expansion of macro 'FOR'
    8 | #define F0R(i,n) FOR(i,0,n)
      |                  ^~~
mor.cpp:50:3: note: in expansion of macro 'F0R'
   50 |   F0R (i, adj[on.F].size()) {
      |   ^~~
#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...
#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...