結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2016-02-14 16:56:28 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 332 bytes |
コンパイル時間 | 235 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 06:31:11 |
合計ジャッジ時間 | 979 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d", &N); | ^~~~~~~~~~~~~~~ main.c:11:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d", &t); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ int N,item[11] = {0}, sum = 0; int i, j, t, s = 0; scanf("%d", &N); for(i = 0; i < N; i++){ for(j = 0; j < 3; j++){ scanf("%d", &t); item[t] ++; if(item[t] == 2){ item[t] = 0; sum++; } } } for(i = 1; i < 11; i++) s += item[i]; sum += s / 4; printf("%d\n", sum); }