結果
問題 | No.489 株に挑戦 |
ユーザー | Yut176 |
提出日時 | 2017-02-24 23:34:15 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 737 bytes |
コンパイル時間 | 961 ms |
コンパイル使用メモリ | 83,164 KB |
実行使用メモリ | 4,388 KB |
最終ジャッジ日時 | 2023-08-31 00:09:07 |
合計ジャッジ時間 | 2,571 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 2 ms
4,376 KB |
testcase_03 | AC | 1 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 1 ms
4,380 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 5 ms
4,384 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 2 ms
4,380 KB |
testcase_26 | AC | 27 ms
4,380 KB |
testcase_27 | AC | 28 ms
4,376 KB |
testcase_28 | WA | - |
testcase_29 | AC | 1 ms
4,376 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
ソースコード
#include<iostream> #include<algorithm> #include<cstdio> #include<cstdlib> #include<vector> #include<map> #include<queue> #include<string> #include<sstream> #include<cmath> #include<numeric> using namespace std; int main(){ int n, d, k; cin >> n >> d >> k; vector<int> x(n); for(int i=0; i<n; i++) cin >> x[i]; int lmax = 0; int rmax = 0; int diffmax = 0; int r = 0; for(int l=0; l<n; l++){ // r = l; while(r - l <= d){ if( r >= n ) break; if( diffmax < x[r] - x[l] ){ lmax = l; rmax = r; diffmax = x[r] - x[l]; } r++; } } long long int ans = diffmax * k; cout << ans << endl; if( ans != 0 ) cout << lmax << " " << rmax << endl; return 0; }