結果
問題 | No.702 中央値を求めよ LIMITED |
ユーザー |
|
提出日時 | 2018-06-17 22:25:46 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 428 bytes |
コンパイル時間 | 276 ms |
コンパイル使用メモリ | 30,080 KB |
実行使用メモリ | 22,932 KB |
最終ジャッジ日時 | 2024-06-30 16:37:37 |
合計ジャッジ時間 | 12,815 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 2 |
other | RE * 25 |
コンパイルメッセージ
main.c: In function 'main': main.c:20:21: warning: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types] 20 | qsort(a,n,4,"\x8b\7+\6\xc3"); | ^~~~~~~~~~~~~~~ | | | char * In file included from main.c:2: /usr/include/stdlib.h:839:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'char *' 839 | __compar_fn_t __compar) __nonnull ((1, 4)); | ~~~~~~~~~~~~~~^~~~~~~~
ソースコード
#include <stdio.h>#include <stdlib.h>unsigned int x=0,y=1,z=2,w=3,a[6000000],k;unsigned int generate(){unsigned int t = (x^(x<<11));x = y;y = z;z = w;w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));return w;}int main(){unsigned int i=0,n=0,m=0;scanf("%u",&x);for(;i<10000001;i++){k=generate();if(k<1<<30)m++;else if(k<(1<<31|1<<30))a[n++]=k;}qsort(a,n,4,"\x8b\7+\6\xc3");printf("%u\n",a[5000000-m]);}