結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2018-03-31 20:34:14 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 36,940 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:42:47 |
合計ジャッジ時間 | 1,017 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ main.cpp:12:22: 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>#include <algorithm>#include <deque>using namespace std;using ll = long long;//29int main() {int n, a, b, c, count[10] = { 0 };scanf("%d", &n);for (int i = 0; i < n; i++) {scanf("%d %d %d", &a, &b, &c);count[a - 1]++, count[b - 1]++, count[c - 1]++;}int total = 0, rem = 0;for (int i = 0; i < 10; i++) {total += count[i] / 2;rem += count[i] & 1;}total += rem / 4;printf("%d\n", total);}