結果
問題 |
No.489 株に挑戦
|
ユーザー |
![]() |
提出日時 | 2017-06-28 20:14:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 555 bytes |
コンパイル時間 | 474 ms |
コンパイル使用メモリ | 59,868 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-10-04 14:54:38 |
合計ジャッジ時間 | 4,295 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 2 WA * 10 TLE * 2 -- * 21 |
ソースコード
#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; }