結果

問題 No.489 株に挑戦
ユーザー rapurasurapurasu
提出日時 2017-02-24 23:11:07
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 961 bytes
コンパイル時間 1,192 ms
コンパイル使用メモリ 153,128 KB
実行使用メモリ 10,468 KB
最終ジャッジ日時 2023-08-30 23:44:50
合計ジャッジ時間 3,890 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
4,380 KB
testcase_01 AC 43 ms
5,684 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 51 ms
4,704 KB
testcase_17 AC 6 ms
4,376 KB
testcase_18 AC 37 ms
4,380 KB
testcase_19 AC 24 ms
4,432 KB
testcase_20 AC 83 ms
6,772 KB
testcase_21 AC 17 ms
4,712 KB
testcase_22 AC 7 ms
4,376 KB
testcase_23 AC 36 ms
4,376 KB
testcase_24 AC 99 ms
6,676 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 69 ms
9,788 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 79 ms
10,012 KB
testcase_31 AC 67 ms
10,468 KB
testcase_32 AC 46 ms
4,380 KB
testcase_33 AC 95 ms
6,540 KB
testcase_34 AC 79 ms
4,708 KB
testcase_35 AC 30 ms
4,380 KB
testcase_36 AC 11 ms
4,376 KB
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
LL N,D,K;
LL X[100001];
map<LL,int>m;
int main(){
	cin>>N>>D>>K;
	REP(i,N){
	   cin>>X[i];
	}
	LL ans=0;
	int mi=-1;
	int ma=-1;
	int num=-1;
	REP(i,N){
	    if(D<i){
	       m[X[i-(D+1)]]--;
	       if(m[X[i-(D+1)]]<=0)m.erase(X[i-(D+1)]);
	    }
	    if(m.find(X[i])==m.end()){
	       m[X[i]]=1;
	    }else{
	       m[X[i]]++;
	    }
	    LL temp=m.begin()->first;
	    if(X[i]-temp>ans){
	       num=i;
	       ma=X[i];
	       mi=temp;
	       ans=ma-mi;
	    }
	}
	if(ma==-1){
	   cout<<0<<endl;
	   return 0;
        }
        cout<<ans*K<<endl;
        for(int i=num;i>=0;i--){
            if(X[i]==mi){
               cout<<i<<" "<<num<<endl;
               return 0;
            }
        }
	return(0);
}
0