Submission #41350
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #include <iostream> #include <string> #include <stack> #include <queue> #include <cstring> #include <algorithm> #include <vector> //#include <cstdio> #include <cmath> #include <cstdlib> #include <functional> #include <map> #include <numeric> using namespace std; #define elif else if #define echo cout << #define read cin >> #define fin << '\n' #define finn cout << '\n' #define forin(i, n) for ( int i = 0; i < n; i++ ) #define zu >> #define und << #define alles(obj) obj.begin(), obj.end() #define bash push_back #define makePair make_pair // type-define #define String string #define Stack stack #define Queue queue #define pQueue priority_queue #define Vector vector #define Pair pair #define Map map typedef long long llong; typedef bool boolean; typedef Pair< int , int > Pii; typedef Vector< int > Vi; // utils const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}; const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1}; boolean canMove( int x, int y, int w, int h){ return (x>=0&&y>=0&&x<w&&y<h);}; const int INF = 1 << 29; Vi vec; int main(){ cin.tie(0); ios::sync_with_stdio( false ); int n; read n; for ( int i = 0; i < n; i++ ) { int a; read a; vec.bash(a); } int q; read q; for ( int i = 0; i < q; i++ ) { int v; read v; echo ( upper_bound( alles(vec), v) - lower_bound( alles(vec), v) ) fin; } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0948 - Number-Collection |
ユーザー名 | r1825 |
投稿日時 | 2018-08-20 06:27:21 |
言語 | C++14 |
状態 | Accepted |
得点 | 10 |
ソースコード長 | 1450 Byte |
最大実行時間 | 303 ms |
最大メモリ使用量 | 27144 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | a_NQ-small | 1 / 1 | *E?? |
2 | b_a-small-positive | 1 / 1 | *?E? |
3 | c_a-unique | 3 / 3 | *??E |
4 | d_ALL | 5 / 5 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | |||
---|---|---|---|---|---|---|---|
input-sample1EEE | AC | 23 ms | 480 KB |
1
|
2
|
3
|
4
|
input-sample2E__ | AC | 31 ms | 696 KB |
1
|
4
|
||
input01EEE | AC | 20 ms | 528 KB |
1
|
2
|
3
|
4
|
input02EEE | AC | 18 ms | 608 KB |
1
|
2
|
3
|
4
|
input03E__ | AC | 19 ms | 556 KB |
1
|
4
|
||
input04E__ | AC | 27 ms | 508 KB |
1
|
4
|
||
input05E__ | AC | 17 ms | 712 KB |
1
|
4
|
||
input06_E_ | AC | 118 ms | 5244 KB |
2
|
4
|
||
input07_E_ | AC | 152 ms | 11888 KB |
2
|
4
|
||
input08_E_ | AC | 187 ms | 20340 KB |
2
|
4
|
||
input09__E | AC | 303 ms | 20312 KB |
3
|
4
|
||
input10__E | AC | 160 ms | 11324 KB |
3
|
4
|
||
input11__E | AC | 207 ms | 23844 KB |
3
|
4
|
||
input12___ | AC | 108 ms | 9040 KB |
4
|
|||
input13___ | AC | 126 ms | 12196 KB |
4
|
|||
input14___ | AC | 94 ms | 17628 KB |
4
|
|||
input15___ | AC | 249 ms | 26388 KB |
4
|
|||
input16___ | AC | 258 ms | 27144 KB |
4
|
|||
input17___ | AC | 240 ms | 26600 KB |
4
|
|||
input18 | AC | 40 ms | 9820 KB |
4
|