| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 838366 | ma_moutahid | Carnival Tickets (IOI20_tickets) | C++17 | 3078 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "tickets.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
long long prize=0;
using ll=long long;
#define vi vector<long long>
#define vii vector<vi>
#define pi pair<long long,long long>
ll INF=1e9;
vector<vi> ans;
int n,m;
long long find_maximum(int k, std::vector<std::vector<int>> x) {
n = x.size();
m = x[0].size();
long long prize=0;
std::vector<std::vector<int>> answer(n, std::vector<int>(m));
vector<vi>ones(n);
vector<vi>zeroes(n);
map<int,int>diff;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(x[i][j])ones[i].push_back(j);
else { zeroes[i].push_back(j);}
}
diff.insert(pi(ones[i].size()-zeroes[i].size(),i));
}
ll result=0;
for(int i=0;i<k;i++){
vi used(n);
int z=0;int o=0;
auto b=diff.rbegin();
int ao=0;
int az=0;
while(o<n/2){
int node=b->second;
if(used[node])continue;
used[node]=1;
o++;
if(!ones[node].empty()){
answer[node][ones[node].back()]=i;
ao++;
}
else {
answer[node][zeroes[node].back()]=i;
}
}
auto b2=diff.begin();
while(z<n/2){
int node=b2->second;
if(used[node])continue;
used[node]=1;
z++;
if(!zeroes[node].empty()){
answer[node][zeroes[node].back()]=i;
az++;
}
else {
answer[node][ones[node].back()]=i;
}
}
result+=min(ao,az);
}
return result;
}
컴파일 시 표준 에러 (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... | ||||
