結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-05 17:25:10 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 295 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 27,084 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:06:50 |
| 合計ジャッジ時間 | 997 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:9:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%d",&t);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void)
{
int n,i,j,t,a[10]={0},s=0;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<3;j++){
scanf("%d",&t);
a[t-1]++;
}
}
for(i=0;i<10;i++){
while(a[i]>1){
a[i]-=2;
s++;
}
}
t=0;
for(i=0;i<10;i++)t+=a[i];
s+=t/4;
printf("%d",s);
return 0;
}