Submission #00012


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <bits/stdc++.h>
using namespace std;
int m, nmin, nmax, p[11111];
int gap[11111];
int j = 0;
int mosp, most = 0;
int main()
{
while (1) {
cin >> m >> nmin >> nmax;
memset(p, 0, sizeof(p));
memset(gap, 0, sizeof(gap));
most = 0;
mosp = 0;
j = 0;
if (m == 0 && nmin == 0 && nmax == 0) {
break;
}
for (int i = 0; i < m; i++) {
cin >> p[i];
}
for (int i = nmin-1; i < nmax; i++) {
gap[j] = p[i] - p[i+1];
j++;
}
/*for (int i = 0; i < nmax - nmin + 1; i++) {
cout << gap[i] << ' ';
}
cout << endl;*/
for (int i = 0; i < nmax - nmin + 1; i++) {
if (most <= gap[i]) {
most = gap[i];
mosp = i;
}
}
cout << nmin+mosp << endl;
}
}

ステータス

項目 データ
問題 0001 - 入学試験
ユーザー名 ei1439
投稿日時 2016-03-30 13:16:48
言語 C++11
状態 Accepted
得点 10
ソースコード長 821 Byte
最大実行時間 18 ms
最大メモリ使用量 520 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 17 ms 476 KB
1
A2 AC 18 ms 492 KB
1
A3 AC 18 ms 508 KB
1
A4 AC 15 ms 520 KB
1