Submission #584682

# Submission time Handle Problem Language Result Execution time Memory
584682 2022-06-27T19:38:02 Z Newtech66 Teams (CEOI11_tea) C++17
0 / 100
265 ms 29996 KB
#include<bits/stdc++.h>
using namespace std;
using lol=long long int;
#define endl "\n"
const lol mod1=1e9+7,mod2=998244353,mod3=1000000000000000003;
const lol inf=1e18+8;
const double eps=1e-12;
const double PI=acos(-1.0);
const int N=3e5+5;
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
typedef tree<pair<int,int>,null_type,less<pair<int,int> >,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int _=1;
//cin>>_;
while(_--)
{
    int n;
    cin>>n;
    vector<pair<int,int>> v(n);
    for(int i=0;i<n;i++)
    {
        cin>>v[i].first;
        v[i].second=i+1;
    }
    sort(v.begin(),v.end());
    vector<pair<int,int>> teams;
    for(int i=n-1;i>=0;)
    {
        teams.push_back({i-v[i].first,i});
        i-=v[i].first;
    }
    cout<<(int)teams.size()<<endl;
    for(auto [l,r]:teams)
    {
        cout<<r-l<<" ";
        for(int i=l+1;i<=r;i++) cout<<v[i].second<<" ";
        cout<<endl;
    }
}
return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 20]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 100]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 200]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 340 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 4999]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Integer parameter [name=k_j] equals to 0, violates the range [1, 5000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 19 ms 2584 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 23 ms 2828 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 191 ms 21120 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 265 ms 28828 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 247 ms 29996 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -