Cod sursa(job #2038911)
Utilizator | Data | 14 octombrie 2017 09:58:37 | |
---|---|---|---|
Problema | Interclasari | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
#include <queue>
using namespace std;
priority_queue<int> q;
int k, n;
ifstream f("interclasari.in");
ofstream g("interclasari.out");
int main()
{
f >> k;
for (int i = 1;i <= k;++i)
{
f >> n;
for (int j = 1;j <= n;++j)
{
int x;
f >> x;
q.push(-x);
}
}
g << q.size() << "\n";
while(!q.empty())
{
g << -q.top() << " ";
q.pop();
}
f.close();
g.close();
return 0;
}