結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  sasa | 
| 提出日時 | 2025-03-03 14:12:20 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 715 bytes | 
| コンパイル時間 | 161 ms | 
| コンパイル使用メモリ | 26,960 KB | 
| 実行使用メモリ | 7,720 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:21:26 | 
| 合計ジャッジ時間 | 1,028 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 22 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d",&count);
      |         ^~~~~~~~~~~~~~~~~~
main.c:17:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |                         scanf("%d",&reward);
      |                         ^~~~~~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <stdlib.h>
int main(void){
	// アイテム一覧・個数
	int judgment[10] = {0,0,0,0,0,0,0,0,0,0};
	int *p = judgment;
	// ボス討伐回数
	int count = 0;
	scanf("%d",&count);
	
	int i = 0;
	while(i != count){
		for(int i = 0;i < 3;i++){
			// ボス討伐時にゲットできるアイテム
			int reward = 0;
			scanf("%d",&reward);
			printf("報酬アイテム%d\n",reward);
			// ゲットしたアイテムを配列に格納(カウント)
			for(int j = 0;j < 10;j++){
				if(reward == j + 1){
					p[i] += 1;
				}
			}
		}
		i++;
	}
	int ans = 0;
	for(int i = 0;i < 10;i++){
		printf("アイテム個数%d:%d\n",i,p[i]);
		ans += (p[i] / 2);
	}
	printf("%d",ans);
}
            
            
            
        