Submission #394737

# Submission time Handle Problem Language Result Execution time Memory
394737 2021-04-27T09:02:35 Z suren Swapping Cities (APIO20_swap) C++14
0 / 100
5 ms 4940 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
int n, m;
vector < int > u, v, w;
vector < int > vc[200045];
void init(int N, int M,
          std::vector<int> U, std::vector<int> V, std::vector<int> W) {
		u = U;
		v = V;
		w = W;
}
bool vis[200045];
int getMinimumFuelCapacity(int X, int Y) {
	int flag = true, i;
	map < pair < int , int >, int > mp;
	for( i = 0; i < m; i ++ ){
		vc[ u[i] ].pb( v[i] );
		vc[ v[i] ].pb( u[i] );
		mp[ mk( u[i], v[i] ) ] = w[i];
		mp[ mk( v[i], u[i] ) ] = w[i];
	}
	for( i = 0; i < n; i ++ ){
		if( vc[i].size() != 2 ){
			flag = false;
			break;
		}
	}
	if( flag == true ){
		int ans = 0;
		for( i = 0; i < m; i ++ ){
			ans = max( ans, w[i] );
		}
		return ans;
	}
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 4940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 4940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 4940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 4940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 4940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 4940 KB Output isn't correct
2 Halted 0 ms 0 KB -