Cod sursa(job #2008301)
| Utilizator | Data | 6 august 2017 02:47:36 | |
|---|---|---|---|
| Problema | Sortare prin comparare | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.48 kb |
#include<cstdio>
#include<sys/mman.h>
#include<algorithm>
struct ano{
char*s;
ano():s((char*)mmap(0,1<<24,1,2,0,0)){}
operator int(){
int x=0;
while(*s<48)++s;
while(*s>32)
x=x*10+*s++-48;
return x;
}
}buf;
const int N = 500000;
int a[N];
int main(){
freopen("algsort.in", "r", stdin);
freopen("algsort.out", "w", stdout);
int n = buf;
for (int i=0; i<n; ++i) a[i] = buf;
std::sort(a, a+n);
for (int i=0; i<n; ++i) printf("%d ", a[i]);
}