Submission #330238

# Submission time Handle Problem Language Result Execution time Memory
330238 2020-11-24T08:27:00 Z egas Swapping Cities (APIO20_swap) C++14
0 / 100
480 ms 38152 KB
#include <bits/stdc++.h>
using namespace std;



map<int,set<int>> adj;
map<pair<int,int>,int> edwt;
int SUBTASK1=0;
bool isCyc=0;
bool isCycle(){
	for(auto x:adj){
		if(x.second.size()<=1)return false;
	}
}
void init(int N, int M,std::vector<int> U, std::vector<int> V, std::vector<int> W) {
	for(int i=0;i<M;i++){
		int x=U[i];
		int y=V[i];
		int z=W[i];
		SUBTASK1=max(SUBTASK1,(W[i]));
		adj[x].insert(y);
		adj[y].insert(x);
		edwt[{x,y}]=z;
		edwt[{y,x}]=z;
	}
	isCyc=isCycle();
}

int getMinimumFuelCapacity(int X, int Y) {
	if(isCyc){
		return SUBTASK1;
	}else
		return -1;
}

Compilation message

swap.cpp: In function 'bool isCycle()':
swap.cpp:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 492 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 2 ms 620 KB Output is correct
8 Correct 2 ms 620 KB Output is correct
9 Correct 290 ms 26860 KB Output is correct
10 Correct 404 ms 32620 KB Output is correct
11 Correct 376 ms 32108 KB Output is correct
12 Correct 431 ms 34028 KB Output is correct
13 Correct 411 ms 34028 KB Output is correct
14 Correct 311 ms 26860 KB Output is correct
15 Correct 446 ms 34736 KB Output is correct
16 Correct 433 ms 33948 KB Output is correct
17 Correct 480 ms 35796 KB Output is correct
18 Correct 469 ms 35920 KB Output is correct
19 Runtime error 71 ms 13676 KB Execution killed with signal 6 (could be triggered by violating memory limits)
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Incorrect 371 ms 38152 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 0 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 492 KB Output is correct
5 Correct 2 ms 620 KB Output is correct
6 Correct 2 ms 620 KB Output is correct
7 Correct 2 ms 620 KB Output is correct
8 Correct 2 ms 620 KB Output is correct
9 Correct 290 ms 26860 KB Output is correct
10 Correct 404 ms 32620 KB Output is correct
11 Correct 376 ms 32108 KB Output is correct
12 Correct 431 ms 34028 KB Output is correct
13 Correct 411 ms 34028 KB Output is correct
14 Correct 311 ms 26860 KB Output is correct
15 Correct 446 ms 34736 KB Output is correct
16 Correct 433 ms 33948 KB Output is correct
17 Correct 480 ms 35796 KB Output is correct
18 Correct 469 ms 35920 KB Output is correct
19 Incorrect 371 ms 38152 KB Output isn't correct
20 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Output isn't correct