| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 317285 | shrek12357 | Teams (CEOI11_tea) | C++14 | 2591 ms | 82728 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <climits>
#include <cmath>
#include <fstream>
#include <queue>
#include <stack>
#include <bitset>
using namespace std;
#define ll long long
//cin.tie(0);ios_base::sync_with_stdio(0);
int main() {
cin.tie(0);ios_base::sync_with_stdio(0);
int n;
cin >> n;
int counter = 0;
vector<int> nums;
priority_queue<pair<int, int>> pq;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> groups;
for (int i = 0; i < n; i++) {
int temp;
cin >> temp;
pq.push({ temp, i });
}
vector<vector<int>> ans;
while (pq.size() > 0) {
int cur = pq.top().first, idx = pq.top().second;
pq.pop();
cur--;
if (cur <= pq.size()) {
vector<int> temp;
temp.push_back(idx);
ans.push_back(temp);
for (int i = 0; i < cur; i++) {
ans[counter].push_back(pq.top().second);
pq.pop();
}
groups.push({ ans[counter].size(), counter });
counter++;
}
else {
int g = groups.top().second;
ans[g].push_back(idx);
groups.pop();
groups.push({ ans[g].size(), g });
}
}
cout << counter << endl;
for (int i = 0; i < ans.size(); i++) {
cout << ans[i].size() << " ";
for (int j = 0; j < ans[i].size(); j++) {
cout << ans[i][j] + 1 << " ";
}
cout << endl;
}
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
