Submission #1111404

# Submission time Handle Problem Language Result Execution time Memory
1111404 2024-11-12T08:11:24 Z gohchingjayk Drivers (BOI24_drivers) C++14
0 / 100
207 ms 391752 KB
#include <bits/stdc++.h>

using namespace std;
using i64 = int64_t;

uint32_t adjmax[10000][10000];

int main() {
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(false);

	memset(adjmax, -1, sizeof(adjmax));

	int cities, roads, queries;
	cin >> cities >> roads >> queries;

	for (int i = 0; i < roads; ++i) {
		int a, b, p;
		cin >> a >> b >> p;
		adjmax[a][b] = adjmax[b][a] = p;
	}

	for (int i = 0; i < cities; ++i)
		for (int j = 0; j < cities; ++j)
			for (int k = 0; k < cities; ++k) {
				adjmax[i][j] = min(adjmax[i][j], max(adjmax[i][k], adjmax[k][j]));
			}

	for (int i = 0; i < queries; ++i) {
		int a, b, p;
		cin >> a >> b >> p;
		if (adjmax[a][b] != -1 && p >= adjmax[a][b]) cout << "TAIP";
		else cout << "NE";
		cout << "\n";
	}
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:33:20: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   33 |   if (adjmax[a][b] != -1 && p >= adjmax[a][b]) cout << "TAIP";
      |       ~~~~~~~~~~~~~^~~~~
Main.cpp:33:31: warning: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
   33 |   if (adjmax[a][b] != -1 && p >= adjmax[a][b]) cout << "TAIP";
      |                             ~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 391600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 204 ms 391668 KB Output is correct
2 Incorrect 207 ms 391752 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 391600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 391600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 391600 KB Output isn't correct
2 Halted 0 ms 0 KB -