Submission #00129


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0), ios::sync_with_stdio(false);
long long n;cin>>n;
vector<long long> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
}
long long q;cin>>q;
long long v;
for(int i=0;i<q;i++){
cin>>v;
long long l=lower_bound(a.begin(),a.end(),v)-a.begin();
long long u=upper_bound(a.begin(),a.end(),v)-a.begin();
cout<<u-l<<"\n";
}
}

ステータス

項目 データ
問題 0020 - Number-Collection
ユーザー名 ei2331
投稿日時 2023-11-14 16:24:02
言語 C++17
状態 Accepted
得点 50
ソースコード長 427 Byte
最大実行時間 299 ms
最大メモリ使用量 31340 KB

セット

セット 得点 Cases
1 a_NQ-small 5 / 5 *E??
2 b_a-small-positive 5 / 5 *?E?
3 c_a-unique 15 / 15 *??E
4 d_ALL 25 / 25 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input-sample1EEE AC 32 ms 476 KB
1
2
3
4
input-sample2E__ AC 16 ms 432 KB
1
4
input01EEE AC 19 ms 516 KB
1
2
3
4
input02EEE AC 21 ms 456 KB
1
2
3
4
input03E__ AC 17 ms 404 KB
1
4
input04E__ AC 19 ms 608 KB
1
4
input05E__ AC 25 ms 672 KB
1
4
input06_E_ AC 121 ms 6240 KB
2
4
input07_E_ AC 146 ms 14628 KB
2
4
input08_E_ AC 194 ms 20676 KB
2
4
input09__E AC 299 ms 22908 KB
3
4
input10__E AC 152 ms 9680 KB
3
4
input11__E AC 212 ms 26388 KB
3
4
input12___ AC 102 ms 8356 KB
4
input13___ AC 135 ms 11168 KB
4
input14___ AC 96 ms 14672 KB
4
input15___ AC 242 ms 30196 KB
4
input16___ AC 243 ms 30892 KB
4
input17___ AC 227 ms 31340 KB
4
input18 AC 40 ms 8108 KB
4