結果
| 問題 |
No.489 株に挑戦
|
| コンテスト | |
| ユーザー |
%20
|
| 提出日時 | 2017-02-27 14:09:03 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 474 bytes |
| コンパイル時間 | 364 ms |
| コンパイル使用メモリ | 21,632 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-11 19:22:48 |
| 合計ジャッジ時間 | 1,494 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 17 |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
1 | max(a,b){return a>b?a:b;}
| ^~~
main.c: In function ‘max’:
main.c:1:1: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:1: warning: type of ‘b’ defaults to ‘int’ [-Wimplicit-int]
main.c: At top level:
main.c:2:1: warning: data definition has no type or storage class
2 | b=1<<17;
| ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
3 | N,D,K,x[1<<19],j,k;
| ^
main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘N’ [-Wimplicit-int]
main.c:3:3: warning: type defaults to ‘int’ in declaration of ‘D’ [-Wimplicit-int]
3 | N,D,K,x[1<<19],j,k;
| ^
main.c:3:5: warning: type defaults to ‘int’ in declaration of ‘K’ [-Wimplicit-int]
3 | N,D,K,x[1<<19],j,k;
| ^
main.c:3:7: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
3 | N,D,K,x[1<<19],j,k;
| ^
main.c:3:16: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
3 | N,D,K,x[1<<19],j,k;
| ^
main.c:3:18: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int]
3 | N,D,K,x[1<<19],j,k;
| ^
main.c:4:1: warning: data definition has no type or storage class
4 | l,r,L,R;
| ^
main.c:4:1: warning: type defaults to ‘int’ in declaration of ‘l’ [-Wimplicit-int]
main.c:4:3: warning: type defaults to ‘int’ in declaration of ‘r’ [-Wimplicit-int]
4 | l,r,L,R;
| ^
main.c:4:5: warning: type defaults to ‘int’ in declaration of ‘L’ [-Wimplicit-int]
4 | l,r,L,R;
| ^
main.c:4:7: warning: type defaults to ‘int’ in declaration of ‘R’ [-Wimplicit-int]
4 | l,r,L,R;
| ^
main.c:5:1: warning: data definition has no type or stora
ソースコード
max(a,b){return a>b?a:b;}
b=1<<17;
N,D,K,x[1<<19],j,k;
l,r,L,R;
i,t,m;
main(){
for(scanf("%d%d%d",&N,&D,&K);~scanf("%d",x+b+i++););
for(i=b;--i;)x[i]=x[i*2|x[i*2+1]>x[i*2]];
for(i=0;i<N;++i){
for(L=x[l=b+i],R=x[r=b+i+D];l>>1!=r>>1;l>>=1,r>>=1){
l&1||(L=max(L,x[l^1]));
r&1&&(R=max(R,x[r^1]));
}
if((t=max(L,R)-x[b+i]-m)>0){
j=i;
m+=t;
}
}
if(m){
for(k=j;x[b+k]-x[b+j]!=m;++k);
printf("%ld\n%d %d\n",m*K,j,k);
}else{
puts("0");
}
return 0;
}
%20