Submission #00025
ソースコード
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 | #include<iostream> using namespace std; int main(){ while (1){ int m; int nmin,nmax; int p[201]; int ans=-1; int ansp=-1; int mae=-1; memset (p,-1, sizeof (p)); scanf ( "%d %d %d" ,&m,&nmin,&nmax); if (m == 0 && nmin == 0 && nmax==0){ break ; } for ( int i=0;i<m;i++){ scanf ( "%d" ,&p[i]); } for ( int i=nmin;i<=nmax;i++){ mae=ans; ans=p[i-1]-p[i]; if (mae <= ans){ ansp = i; } } printf ( "%d\n" ,ansp); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0001 - 入学試験 |
ユーザー名 | ei1437 |
投稿日時 | 2016-03-30 13:26:54 |
言語 | C++11 |
状態 | Compile Error |
得点 | 0 |
ソースコード長 | 533 Byte |
最大実行時間 | - |
最大メモリ使用量 |
コンパイルメッセージ
./Main.cpp: In function ‘int main()’: ./Main.cpp:11:26: error: ‘memset’ was not declared in this scope memset(p,-1,sizeof(p)); ^
セット
セット | 得点 | Cases |
---|
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|