結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2018-06-21 15:18:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 387 bytes |
コンパイル時間 | 119 ms |
コンパイル使用メモリ | 23,040 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 17:36:08 |
合計ジャッジ時間 | 866 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", &N); | ~~~~~^~~~~~~~~~ main.cpp:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d %d %d", &a, &b, &c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(void){ int i; int N, a, b, c; int S[11] = {}; int PowerUP = 0, sum = 0; scanf("%d", &N); for(i = 0; i < N; i++){ scanf("%d %d %d", &a, &b, &c); S[a]++; S[b]++; S[c]++; } for(i = 0; i < 11; i++){ PowerUP += S[i] / 2; S[i] = S[i] % 2; sum += S[i]; } PowerUP += sum / 4; printf("%d\n", PowerUP); return 0; }