結果
| 問題 |
No.45 回転寿司
|
| ユーザー |
|
| 提出日時 | 2016-12-23 05:06:08 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 286 bytes |
| コンパイル時間 | 710 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-14 15:16:05 |
| 合計ジャッジ時間 | 4,576 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 5 RE * 25 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d",&N);
| ^~~~~~~~~~~~~~
main.c:11:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d",&v[i]);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int max(int a,int b);
int main(){
int i,j,k,N,v[101];
int t=0,p=0,q=0;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&v[i]);
t=q+v[i];
q=max(p,q);
p=t;
}
printf("%d\n",max(p,q));
return 0;
}
int max(int a,int b){
if(a>b)return a;
else return b;
}