Submission #672665

#TimeUsernameProblemLanguageResultExecution timeMemory
672665haxormanTeams (CEOI11_tea)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = 1e6 + 7;   pair<int,int> arr[mxN];   int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n;   for (int i = 0; i < n; ++i) { cin >> arr[i].first; arr[i].second = i + 1; } sort(arr, arr + n, greater<pair<int,int>>()); vector<vector<int>> ans; for (int i = 0; i < n;) { if (arr[i].first > n - i) { if (!ans.size()) { cout << "0\n"; exit(0); } sort(ans.begin(), ans.end()); ans[0].push_back(arr[i].second); ++i; } else { ans.push_back({arr[i].second}); int tmp = i + 1; while (ans.back().size() < arr[i].first) { ans.back().push_back(arr[tmp++].second); } i = tmp; } }   cout << ans.size() << "\n"; for (auto vec : ans) { cout << vec.size() << ' '; for (auto x : vec) { cout << x << ' '; } cout << "\n"; } }

Compilation message (stderr)

tea.cpp:5:5: error: extended character   is not valid in an identifier
    5 |      
      |     ^
tea.cpp:7:5: error: extended character   is not valid in an identifier
    7 |      
      |     ^
tea.cpp:13:5: error: extended character   is not valid in an identifier
   13 |      
      |     ^
tea.cpp:40:5: error: extended character   is not valid in an identifier
   40 |      
      |     ^
tea.cpp:5:5: error: '\U000000a0' does not name a type
    5 |      
      |     ^
tea.cpp:7:5: error: '\U000000a0' does not name a type
    7 |      
      |     ^