Cod sursa(job #1740712)
Utilizator | Data | 12 august 2016 09:12:27 | |
---|---|---|---|
Problema | Interclasari | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <fstream>
#include <algorithm>
using namespace std;
unsigned short int K;
unsigned int Ni;
unsigned int photos[20000001];
unsigned int temp;
unsigned int i, j;
unsigned int X;
int main ()
{
ifstream fin ("interclasari.in");
fin >> K;
for (i=1; i<=K; i++)
{
fin >> Ni;
for (j=1; j<=Ni; j++)
{
X++;
fin >> photos[X];
}
}
fin.close();
sort(photos+1,photos+X+1);
ofstream fout ("interclasari.out");
fout << X << '\n';
for (i=1; i<=X; i++)
fout << photos[i] << ' ';
fout.close();
return 0;
}