結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-02-14 16:56:28 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 5,000 ms |
| コード長 | 332 bytes |
| 記録 | |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 29,768 KB |
| 最終ジャッジ日時 | 2026-02-23 20:35:45 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
| 純コード判定しない問題か言語 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
mosmos_21