結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
ひゅーら
|
| 提出日時 | 2017-06-19 17:06:16 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| コンパイル時間 | 188 ms |
| コンパイル使用メモリ | 26,956 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-10-24 21:02:01 |
| 合計ジャッジ時間 | 853 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 9 |
コンパイルメッセージ
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:13:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d", &a);
| ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#define DEBUG
int main(void){
int n;
scanf("%d", &n);
int items[10];
for(int i = 0; i < 10; i++){
items[i] = 0;
}
for(int i = 0; i < n*3; i++){
int a;
scanf("%d", &a);
items[a-1]++;
}
int ans = 0;
for(int i = 0; i < 10; i++){
while(items[i] > 1){
items[i] -= 2;
ans++;
}
}
int sum = 0;
for(int i = 0; i < 10; i++){
sum += items[i];
}
ans += sum/5;
printf("%d\n", ans);
return 0;
}
ひゅーら