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