# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
300165 | 2020-09-16T22:06:29 Z | model_code | 카니발 티켓 (IOI20_tickets) | C++17 | 1354 ms | 192376 KB |
// huajun-scam #include "tickets.h" #include<bits/stdc++.h> using namespace std; typedef long long int ll; vector<set<pair<ll,ll> > > se; int cur[1505]; long long find_maximum(int k, vector<vector<int>> d) { ll c = d.size(); ll s = d[0].size(); ll sum =0 ,a,b,x,maxn,minx,y,z; vector<vector<int>> answer; for (int i = 0; i < c; i++) { vector<int> row; for(int j=0;j<s;j++)row.push_back(-1); answer.push_back(row); } ll i,j; for(i=0;i<c;i++){ set<pair<ll,ll> > temp; for(j=0;j<s;j++){ temp.insert(make_pair(d[i][j],j)); } se.push_back(temp); } for(i=0;i<k;i++){ vector<tuple<ll,int,int> > v; y = se[0].size(); for(j=0;j<c;j++){ auto it = *se[j].begin(); auto it2 = *(--se[j].end()); cur[j] = it2.second; sum+=it2.first; v.push_back(make_tuple(it.first+it2.first,j,it.second)); } sort(v.begin(),v.end()); for(j=0;j<c/2;j++){ tie(a,b,x) = v[j]; sum-=a; se[b].erase(se[b].begin()); cur[b] = x; } for(j=0;j<c;j++)answer[j][cur[j]] = i; for(j=0;j<c;j++){ if(se[j].size()==y){ se[j].erase(--se[j].end()); } } } allocate_tickets(answer); return sum; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 768 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 308 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 896 KB | Output is correct |
5 | Correct | 46 ms | 8060 KB | Output is correct |
6 | Correct | 1354 ms | 192376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Contestant returned 5 while correct return value is 6. |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Contestant returned 11 while correct return value is 13. |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Contestant returned 11 while correct return value is 13. |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Contestant returned 11 while correct return value is 13. |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 1 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 768 KB | Output is correct |
7 | Correct | 1 ms | 308 KB | Output is correct |
8 | Correct | 0 ms | 256 KB | Output is correct |
9 | Correct | 1 ms | 384 KB | Output is correct |
10 | Correct | 4 ms | 896 KB | Output is correct |
11 | Correct | 46 ms | 8060 KB | Output is correct |
12 | Correct | 1354 ms | 192376 KB | Output is correct |
13 | Incorrect | 1 ms | 256 KB | Contestant returned 5 while correct return value is 6. |
14 | Halted | 0 ms | 0 KB | - |