Submission #00029
ソースコード
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 | #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int i,j; int m=0,mn=0,mx=0; int tmp=0; int ans=0; scanf ( "%d %d %d" ,&m,&mn,&mx); while (m != 0 && mn != 0 && mx != 0){ int p[m]; for (i=0;i<m;i++){ scanf ( "%d" ,&p[i]); } tmp = 0; for (i=mn-1;i<mx;i++){ tmp = max(tmp,p[i] - p[i+1]); } //printf("%d\n",tmp); for (i=mn-1;i<mx;i++){ if (p[i] - p[i+1] == tmp){ ans = i+1; } } printf ( "%d\n" ,ans); scanf ( "%d %d %d" ,&m,&mn,&mx); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0001 - 入学試験 |
ユーザー名 | ei1401 |
投稿日時 | 2016-03-30 13:30:34 |
言語 | C++ |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 597 Byte |
最大実行時間 | 24 ms |
最大メモリ使用量 | 552 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 10 / 10 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 24 ms | 476 KB |
1
|
A2 | AC | 14 ms | 452 KB |
1
|
A3 | AC | 11 ms | 552 KB |
1
|
A4 | AC | 16 ms | 528 KB |
1
|