Submission #1111402

# Submission time Handle Problem Language Result Execution time Memory
1111402 2024-11-12T08:10:24 Z gohchingjayk Drivers (BOI24_drivers) C++14
0 / 100
182 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) {
				if (adjmax[i][j] == -1) adjmax[i][j] = max(adjmax[i][k], adjmax[k][j]);
				else 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:27:22: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   27 |     if (adjmax[i][j] == -1) adjmax[i][j] = max(adjmax[i][k], adjmax[k][j]);
      |         ~~~~~~~~~~~~~^~~~~
Main.cpp:34:20: warning: comparison of integer expressions of different signedness: 'uint32_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
   34 |   if (adjmax[a][b] != -1 && p >= adjmax[a][b]) cout << "TAIP";
      |       ~~~~~~~~~~~~~^~~~~
Main.cpp:34:31: warning: comparison of integer expressions of different signedness: 'int' and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
   34 |   if (adjmax[a][b] != -1 && p >= adjmax[a][b]) cout << "TAIP";
      |                             ~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 175 ms 391752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 182 ms 391584 KB Output is correct
2 Incorrect 182 ms 391752 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 175 ms 391752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 175 ms 391752 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 175 ms 391752 KB Output isn't correct
2 Halted 0 ms 0 KB -