結果

問題 No.489 株に挑戦
ユーザー RIGIH
提出日時 2017-06-28 20:13:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 555 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 58,716 KB
実行使用メモリ 65,536 KB
最終ジャッジ日時 2024-10-04 14:54:29
合計ジャッジ時間 5,115 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 2 WA * 10 TLE * 2 -- * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include <iostream>
#include <cstring>
#include <math.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
	
	//while(1){
		
		int n,d,k;
		cin>>n>>d>>k;

		int *x;
		x=new int[n];
		rep(i,n){
			cin>>x[i];
		}
		int max=0;
		int i1,j1;

		rep(i,n-1){
			rep(j,d){
				if( x[i+j+1]-x[i] > max){
					max=x[i+j+1]-x[i];
					i1=i;j1=j;
				}
			}
		}
		if(max==0){
			cout<<0<<endl;
			return 0;
		}
		//cout<<max<<endl;
		long long MAX=max*k;
		cout<<MAX<<endl;
		cout<<i1<<" "<<i1+j1+1;


		
	//}

	
	return 0;
}
0