이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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();
}
// void dfs(int src,int dest,mii &visit,int &res1,bool &found){
	// visit[src]=1;
	// if(src==dest){
		// found=1;
		// return ;
	// }
	// if(found)return ;
	// for(int x:adj[src]){
		// if(!visit[x]){
			// res1=max(res1,edwt[{src,x}]);
			// wts.erase(wts.find(edwt[{src,x}]));
			// dfs(x,dest,visit,res1,found);
			// if(found)return ;
		// }
	// }
// }
int getMinimumFuelCapacity(int X, int Y) {
	if(isCycle()){
		return SUBTASK1;
	}else
		return -1;
}
컴파일 시 표준 에러 (stderr) 메시지
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 | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |