結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2015-12-28 23:56:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 287 bytes |
コンパイル時間 | 164 ms |
コンパイル使用メモリ | 33,868 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-19 08:14:18 |
合計ジャッジ時間 | 842 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | int a;scanf("%d",&a); | ~~~~~^~~~~~~~~ main.cpp:8:28: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | int t;scanf("%d",&t);t--; | ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h>#include<algorithm>using namespace std;int s[20];int main(){int a;scanf("%d",&a);for(int i=0;i<a*3;i++){int t;scanf("%d",&t);t--;s[t]++;}int cnt=0;int ret=0;for(int i=0;i<10;i++){ret+=s[i]/2;cnt+=s[i]%2;}ret+=cnt/4;printf("%d\n",ret);}