結果
| 問題 |
No.702 中央値を求めよ LIMITED
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-06-17 22:56:59 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 394 bytes |
| コンパイル時間 | 214 ms |
| コンパイル使用メモリ | 29,696 KB |
| 実行使用メモリ | 17,408 KB |
| 最終ジャッジ日時 | 2024-06-30 16:38:41 |
| 合計ジャッジ時間 | 3,109 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 25 |
コンパイルメッセージ
main.c: In function 'main':
main.c:17:21: warning: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
17 | 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<1U<<30)m++;
else if(w<(1U<<31|1U<<30))a[n++]=w;
if(n>=4000000)return 1;
}
qsort(a,n,4,"\x8b\7+\6\xc3");
printf("%u\n",a[5000000-m]);
}