結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
sk3388607083
|
| 提出日時 | 2018-06-21 15:18:51 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 387 bytes |
| 記録 | |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 29,448 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 21:06:45 |
| 合計ジャッジ時間 | 980 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
sk3388607083