Cod sursa(job #2038904)
Utilizator | Data | 14 octombrie 2017 09:56:39 | |
---|---|---|---|
Problema | Interclasari | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <bits/stdc++.h>
using namespace std;
priority_queue<int> q;
ifstream f("interclasari.in");
ofstream g("interclasari.out");
int main()
{
int m,n,x;
f>>m;
while(m--)
{
f>>n;
while(n--)
f>>x, q.push(-x);
}
g<<q.size()<<'\n';
while(!q.empty())
g<<-q.top()<<' ', q.pop();
return 0;
}