| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 581377 | MohamedFaresNebili | 카니발 티켓 (IOI20_tickets) | C++14 | 1 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "tickets.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using pi = pair<ll, pair<ll, ll>>;
using ii = pair<int, int>;
#define pb push_back
#define pp pop_back
#define ff first
#define ss second
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
ll find_maximum(int K, vector<vector<int>> A) {
int N = A.size(), M = A[0].size(); ll res = 0;
vector<vector<int>> S(N, vector<int> (M, -1));
for(int R = 0; R < K; R++) {
vector<pi> curr; vector<ll> arr;
for(int l = 0; l < N; l++) {
for(int i = 0; i < M; i++) {
if(S[l][i] != -1) continue;
curr.pb({A[l][i], {l, i}});
}
}
bool vis[N]; memset(vis, 0, sizeof vis);
sort(curr.begin(), curr.end());
while(arr.size() != N) {
ll best = -1, x = -1, y = -1;
for(ll l = 0; l < 2 * N; l++) {
if(vis[curr[l].ss.ff]) continue;
ll calc = 0;
for(auto u : arr)
calc += abs(u - curr[l].ff);
if(calc > best)
best = calc, x = curr[l].ss.ff, y = curr[l].ss.ss;
}
vis[x] = 1; S[x][y] = R; arr.pb(A[x][y]);
}
sort(arr.begin(), arr.end());
ll md = (arr[N / 2] + arr[N / 2 - 1]) / 2;
for(auto U : arr)
res += abs(U - md);
}
allocate_tickets(S);
return res;
}컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
