結果
| 問題 | 
                            No.45 回転寿司
                             | 
                    
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-12-23 05:04:43 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 293 bytes | 
| コンパイル時間 | 300 ms | 
| コンパイル使用メモリ | 20,736 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-12-14 15:16:00 | 
| 合計ジャッジ時間 | 4,810 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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];		
		j=max(p,q);	
		q=j;
		p=t;
	}
	printf("%d\n",max(p,q));
	return 0;
}
int max(int a,int b){
	if(a>b)return a;
	else return b;
}