結果
| 問題 | No.507 ゲーム大会(チーム決め) |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2017-06-15 07:21:56 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 291 bytes |
| 記録 | |
| コンパイル時間 | 49 ms |
| コンパイル使用メモリ | 26,040 KB |
| 最終ジャッジ日時 | 2026-02-21 23:53:47 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:10: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:1:12: error: type defaults to 'int' in declaration of 'q' [-Wimplicit-int]
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:1:14: error: type defaults to 'int' in declaration of 'l' [-Wimplicit-int]
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:1:16: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:1:18: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:1:20: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int]
1 | a[1<<17],p,q,l,r,m,k;
| ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | c(int*p,int*q){return*p-*q;}
| ^
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | for(;~scanf("%d",a+r);r++);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a[1<<17],p,q,l,r,m,k;
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | for(;~scanf("%d",a+r);r++);
| ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:9: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
5 | qsort(a+3,r-3,4,c);
| ^~~~~
main.c:17:9: error: implicit declaration of fu
ソースコード
a[1<<17],p,q,l,r,m,k;
c(int*p,int*q){return*p-*q;}
main(){
for(;~scanf("%d",a+r);r++);
qsort(a+3,r-3,4,c);
l=2;
while(r-l>1){
m=l+r>>1;
p=3;q=*a+1;k=0;
while(p<q)
p==m?p++:
q==m?q--:
a[p]+a[q]>a[2]+a[m]?p++,q--,k++:
p++;
k<a[1]?r=m:(l=m);
}
printf("%d",a[r]?:-1);
}
testestest