結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
goodbaton
|
| 提出日時 | 2015-07-29 20:46:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 754 bytes |
| 記録 | |
| コンパイル時間 | 537 ms |
| コンパイル使用メモリ | 83,004 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 20:53:42 |
| 合計ジャッジ時間 | 1,342 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
27 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:30:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
30 | scanf("%d%d%d",&a,&b,&c);
| ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstring>
typedef long long ll;
using namespace std;
#define mod 1000003
#define INF 10000000
#define LLINF 2000000000000000000LL
#define SIZE 10000
int main(){
int a,b,c,n,ans=0;
int item[101]={0},sumitem=0;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d%d%d",&a,&b,&c);
item[a]++;
item[b]++;
item[c]++;
}
for(int i=0;i<=100;i++){
ans+=item[i]/2;
sumitem+=item[i]%2;
}
ans+=sumitem/4;
printf("%d\n",ans);
return 0;
}
goodbaton