Pagini recente » Cod sursa (job #2954067) | Cod sursa (job #694141) | Cod sursa (job #602844) | Cod sursa (job #464580) | Cod sursa (job #2291246)
#include <fstream>
#include <queue>
using namespace std;
void Init (char const x []){
freopen (x , "r" , stdin);
}
int const BUFF = 1e6;
char buff [BUFF];
int p;
void nextc (){
if (++ p == BUFF){
p = 0;
fread (buff , 1 , BUFF , stdin);
}
}
int next (){
int a = 0;
while (! isdigit (buff [p]))
nextc ();
while (isdigit (buff [p])){
a = a * 10 + buff [p] - '0';
nextc ();
}
return a;
}
priority_queue <int , vector <int> , greater <int> > q;
ofstream g ("interclasari.out");
int main()
{
Init ("interclasari.in");
int k;
k = next ();
while (k --){
int a;
a = next ();
while (a --)
q . push (next ());
}
g << q . size () << '\n';
while (! q . empty ()){
g << q . top () << ' ';
q . pop ();
}
return 0;
}