結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-30 22:13:24 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 266 bytes |
| 記録 | |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 30,124 KB |
| 最終ジャッジ日時 | 2026-02-23 23:02:25 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:7:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d%d%d",&a,&b,&c);
| ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int main(void){
int n,a,b,c,d[16]={0},i,r = 0,m = 0;
scanf("%d",&n);
for(i = 1;i <= n;i++){
scanf("%d%d%d",&a,&b,&c);
d[a]++;d[b]++;d[c]++;
}
for(i = 1;i <= 10;i++){
r+=(d[i]/2);m+=(d[i]%2);
}
r+=(m/4);
printf("%d\n",r);
return 0;
}