이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "swap.h"
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <climits>
#include <tuple>
#include <ctime>
#include <cstring>
#include <numeric>
#include <functional>
#include <chrono>
#include <cassert>
#include <bitset>
#include <fstream>
#define sz(a) ((int)((a).size()))
// printf("%.10f\n", ans);
using ll = long long;
using namespace std;
bool task1;
int n, m, mx_for_1, x, y;
vector<int> a, b, c;
vector<pair<int, int>> for_2;
bool task(int id)
{
if (id == 1)
{
vector<int> deg(n);
for (int i = 0; i < m; i++)
{
deg[a[i]]++;
deg[b[i]]++;
if (deg[a[i]] > 2 || deg[b[i]] > 2) return 0;
}
return 1;
}
}
void init(int N, int M, std::vector<int> U, std::vector<int> V, std::vector<int> W) {
n = N;
m = M;
a = U;
b = V;
c = W;
for_2 = vector<pair<int, int>>(m);
for (int& i : c) mx_for_1 = max(mx_for_1, i);
if (task(1)) task1 = 1;
}
int getMinimumFuelCapacity(int X, int Y) {
x = X;
y = Y;
if (task1)
{
if (m == n - 1) return -1;
return mx_for_1;
}
else
{
if (n <= 3) return 0;
if (x == 0)
{
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
swap.cpp: In function 'bool task(int)':
swap.cpp:49:1: warning: control reaches end of non-void function [-Wreturn-type]
49 | }
| ^
swap.cpp: In function 'int getMinimumFuelCapacity(int, int)':
swap.cpp:74:9: warning: control reaches end of non-void function [-Wreturn-type]
74 | if (x == 0)
| ~~^~~~
# | 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... |