結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
sorag
|
| 提出日時 | 2022-08-17 20:13:43 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 586 bytes |
| 記録 | |
| コンパイル時間 | 888 ms |
| コンパイル使用メモリ | 101,644 KB |
| 最終ジャッジ日時 | 2025-10-24 21:18:38 |
| 合計ジャッジ時間 | 1,219 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:5: error: ‘sort’ was not declared in this scope; did you mean ‘sqrt’?
22 | sort(all(a));
| ^~~~
| sqrt
ソースコード
#include <iostream>
#include<utility>
#include <vector>
#include <map>
#include<string>
#include<queue>
#include<math.h>
#define pb push_back
#define all(x) begin(x),end(x)
#define ll long long
#define P pair<int,int>
#define lP pait<ll,ll>
using namespace std;
int main() {
int n,cnt=0,ans;
cin>>n;
vector<int> a(3*n);
for(int i=0;i<3*n;i++){
cin>>a[i];
}
sort(all(a));
for(int i=0;i<3*n-1;i++){
if(a[i]==a[i+1]) {
cnt++;
i++;
}
}
ans=cnt+(3*n-2*cnt)/4;
cout<<ans<<endl;
return 0;
}
sorag