結果

問題 No.29 パワーアップ
ユーザー neeet
提出日時 2017-06-16 17:24:20
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 312 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 21,504 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 06:46:31
合計ジャッジ時間 737 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%hd", &n);
      |   ^~~~~~~~~~~~~~~~
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%hd", &t);
      |     ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void)
{
  short n, t, item[10] = {}, sum = 0, i;
  scanf("%hd", &n);
  for(i = 0; i < n * 3; i++){
    scanf("%hd", &t);
    item[t - 1]++;
  }
  t = 0;
  for(i = 0; i < 10; i++){
    sum += item[i] / 2;
    t += item[i] % 2;
  }
  sum += t / 4;
  printf("%hd\n", sum);
  return 0;
}
0