天才的排序算法...
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
int main(int argc, char **argv) {
int i;
omp_set_num_threads(argc);
#pragma omp parallel for
for (i = 0; i < argc - 1; i++) {
long int this = atol(argv);
sleep(this);
printf("%ld\n", this);
fflush(stdout);
}
return 0;
}
原地址:http://dis.4chan.org/read/prog/1295544154
:D有意思啊,用sleep来排序 哈哈,果真天才。。。。。。:luya: 不懂 C++ 的路过,质疑其效率会不会慢? 回复 3# x9x9
没看原文么, 如果 对0 和 21888 进行排序,需要等待的时间是 21888 秒 。:emn10:
页:
[1]