結果
問題 | No.275 中央値を求めよ |
ユーザー |
|
提出日時 | 2018-06-17 21:36:34 |
言語 | C (gcc 13.3.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 197 bytes |
コンパイル時間 | 136 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 01:40:41 |
合計ジャッジ時間 | 7,337 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | AC * 1 RE * 37 |
コンパイルメッセージ
main.c: In function 'main': main.c:8:21: warning: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types] 8 | 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>int main(){int N,i=0;int a[1000];scanf("%d",&N);for(;i<N;i++)scanf("%d",a+i);qsort(a,N,4,"\x8b\7+\6\xc3");printf("%f\n",(a[N/2]+a[~-N/2])/2.0);}