結果
| 問題 | 
                            No.702 中央値を求めよ LIMITED
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-06-17 23:38:11 | 
| 言語 | C  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 367 bytes | 
| コンパイル時間 | 316 ms | 
| コンパイル使用メモリ | 29,440 KB | 
| 実行使用メモリ | 6,912 KB | 
| 最終ジャッジ日時 | 2024-11-22 22:30:21 | 
| 合計ジャッジ時間 | 10,194 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 2 | 
| other | RE * 25 | 
コンパイルメッセージ
main.c: In function 'main':
main.c:16:21: warning: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   16 |         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 a[6000000];
int main(){
	unsigned int i=0,n=0,m=0,t,x,y=1,z=2,w=3;
	scanf("%u",&x);
	for(;i<10000001;i++){
		t = (x^(x<<11));
		x = y;
		y = z;
		z = w;
		w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
		if(w<0x70000000)m++;
		else if(w<0x90000000)a[n++]=w;
	}
	qsort(a,n,4,"\x8b\7+\6\xc3");
	printf("%u\n",a[5000000-m]);
}