이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<vector<int>> vvi;
ll N, M;
ll sub1(int K, const vvi& x) {
vvi ans(N, vector<int>(N, -1));
vector<int> nums(N);
for (int i=0; i<N; ++i) {
nums[i] = x[i][0];
ans[i][0] = 0;
}
sort(nums.begin(), nums.end());
int med = (nums.size()) / 2;
ll sum = 0;
for (int i=0; i<N; ++i) {
sum += abs(nums[i] - nums[med]);
}
allocate_tickets(ans);
return sum;
}
ll sub2(int K, const vvi& x) {
vvi ans(N, vector<int>(N, -1));
}
ll sub3(int K, const vvi& x) {
vvi ans(N, vector<int>(N, -1));
for (int i=0; i<N; ++i) {
}
}
long long find_maximum(int K, std::vector<std::vector<int>> x) {
N = x.size();
M = x[0].size();
if (M == 1) {
return sub1(K, x);
}
//if (K == 0) {
// return sub2(K, x);
//}
set<int> vals;
for (int i=0; i<N; ++i) {
for (int j=0; j<M; ++j) {
vals.insert(x[i][j]);
}
}
//if (vals.size() == 2 && vals.count(0) && vals.count(1)) {
// return sub3(K, x);
//}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
tickets.cpp: In function 'll sub2(int, const vvi&)':
tickets.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
31 | }
| ^
tickets.cpp: In function 'll sub3(int, const vvi&)':
tickets.cpp:38:1: warning: no return statement in function returning non-void [-Wreturn-type]
38 | }
| ^
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |