結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
shiomusubi496
|
| 提出日時 | 2020-07-25 15:46:48 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 297 bytes |
| 記録 | |
| コンパイル時間 | 903 ms |
| コンパイル使用メモリ | 182,140 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-15 22:32:39 |
| 合計ジャッジ時間 | 2,130 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 22 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:6:12: warning: 'N' is used uninitialized [-Wuninitialized]
6 | while(N--){
| ~^~
main.cpp:4:9: note: 'N' was declared here
4 | int N;
| ^
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
vector<int> A(10,0);
while(N--){
int a,b,c;
cin>>a>>b>>c;
A[a-1]++,A[b-1]++,A[c-1]++;
}
int ans=0,cnt=0;
for(int &i:A)ans+=i/2,i%=2;
for(int i:A)cnt+=i;
cout<<ans+cnt/4<<endl;
}
shiomusubi496