# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
781793 | Khizri | Carnival Tickets (IOI20_tickets) | C++17 | 2 ms | 724 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define INF 1e18
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define OK cout<<"Ok"<<endl;
#define MOD (ll)(1e9+7)
int n,m;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
n = x.size();
m = x[0].size();
vector<std::vector<int>> ans(n,vector<int>(m,-1));
ll sum=0;
for(int id=1;id<=k;id++){
vector<pair<ll,pair<ll,pll>>>vt;
for(int i=0;i<n;i++){
ll mn=1e9+7,mx=-1,l=0,r=0;
for(int j=0;j<x[i].size();j++){
if(ans[i][j]!=-1) continue;
if(x[i][j]<mn){
mn=x[i][j];
l=j;
}
if(x[i][j]>mx){
mx=x[i][j];
r=j;
}
}
vt.pb({mn-mx,{i,{l,r}}});
}
sort(all(vt));
vector<ll>v;
for(int i=0;i<n/2;i++){
ll a=vt[i].S.F,l=vt[i].S.S.F,r=vt[i].S.S.S;
ans[a][r]=id-1;
v.pb(x[a][r]);
}
for(int i=n/2;i<n;i++){
ll a=vt[i].S.F,l=vt[i].S.S.F,r=vt[i].S.S.S;
ans[a][l]=id-1;
v.pb(x[a][l]);
}
sort(all(v));
ll b=v[n/2-1];
for(int i=0;i<n;i++){
sum+=abs(b-v[i]);
}
}
allocate_tickets(ans);
return sum;
}
컴파일 시 표준 에러 (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... |