-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
73 lines (53 loc) · 1.53 KB
/
main.cpp
File metadata and controls
73 lines (53 loc) · 1.53 KB
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
69
70
71
72
73
#include <iostream>
#include <functional>
#include <set>
#include <deque>
#include <string>
#include "multiable.h"
struct Compare: std::binary_function<int, int, bool>
{
bool operator()(const int& a, const int& b) const
{
return a > b;
}
};
const int max = 10000;
int main()
{
int yourMark = 1;
MultiableSet<int, true> mi;
MultiableSet<std::string, false> nms;
mi.insert(3).insert(4).insert(3);
nms.insert("Hello").insert("World").insert("Hello");
const MultiableSet<int, true> cmi = mi;
const MultiableSet<std::string, false> cnms = nms;
if (3 == cmi.size())
yourMark = cnms.size();
MultiableSet<int, false> nmt;
MultiableSet<int, true> mt;
for(int i = 0; i < max; ++i)
{
mt.insert(0);
nmt.insert(0);
nms.insert("Testing");
nms.insert("Checking");
}
nms.erase("Checking");
if (cmi.count(4) == nmt.count(0) && mt.count(0) == max)
yourMark = nms.size();
const int v[] = {3, 1, 2, 1, 2, 1, 1};
const int N = sizeof(v) / sizeof(v[0]);
std::deque<int> d(v, v + N);
MultiableSet<int, true, Compare> m1;
MultiableSet<int, false, Compare> m2;
m1.insert<const int*>(v, v + N);
m2.insert(d.begin(), d.end());
Compare c = m1.key_comp();
if (3 == m2.size())
yourMark = m1.count(1);
const std::multiset<int, Compare> m = m1.data();
//const std::set<int, Compare> s = m2.data();
if (3 == m.size())
yourMark = m.size() - m.count(2);
std::cout << "Your mark is " << yourMark << std::endl;
}