提出 #3984344
ソースコード 拡げる
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
int main()
{
LL N, A, B;
in >> N >> A >> B;
std::vector<LL>P(N);
rep(i, N) in >> P[i];
std::sort(P.begin(), P.end());
LL cnt1 = 0, cnt2 = 0, cnt3 = 0;
rep(i, N)
{
if (P[i] <= A) ++cnt1;
if (A < P[i] && P[i] <= B) ++cnt2;
if (P[i] > B) ++cnt3;
}
out << std::min({ cnt1,cnt2,cnt3 }) << std::endl;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Contests |
| ユーザ | babcs2035 |
| 言語 | C++14 (GCC 5.4.1) |
| 得点 | 200 |
| コード長 | 470 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 256 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, sample-01.txt, sample-02.txt, sample-03.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01.txt | AC | 1 ms | 256 KiB |
| 02.txt | AC | 1 ms | 256 KiB |
| 03.txt | AC | 1 ms | 256 KiB |
| 04.txt | AC | 1 ms | 256 KiB |
| 05.txt | AC | 1 ms | 256 KiB |
| 06.txt | AC | 1 ms | 256 KiB |
| 07.txt | AC | 1 ms | 256 KiB |
| sample-01.txt | AC | 1 ms | 256 KiB |
| sample-02.txt | AC | 1 ms | 256 KiB |
| sample-03.txt | AC | 1 ms | 256 KiB |