結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
tottoripaper
|
| 提出日時 | 2014-11-16 23:07:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 16 ms / 5,000 ms |
| コード長 | 434 bytes |
| 記録 | |
| コンパイル時間 | 341 ms |
| コンパイル使用メモリ | 29,728 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 20:50:35 |
| 合計ジャッジ時間 | 1,063 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d %d %d", &a, &b, &c);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
int counter[11];
int main(){
int N;
scanf("%d", &N);
for(int i=0;i<N;i++){
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
counter[a] += 1;
counter[b] += 1;
counter[c] += 1;
}
int res = 0, sum = 0;
for(int i=1;i<=10;i++){
res += counter[i] / 2;
sum += counter[i] % 2;
}
printf("%d\n", res + sum/4);
}
tottoripaper