-
Notifications
You must be signed in to change notification settings - Fork 2
/
saxophone.cpp
81 lines (72 loc) · 2.57 KB
/
saxophone.cpp
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
74
75
76
77
78
79
#define _USE_MATH_DEFINES
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <ctype.h>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <unordered_map>
#define EPSILON 0.00001
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll i, j, k;
map<char, vector<bool>> fingers;
vector<ll> moves(8);
vector<bool> lastFingers;
string song;
ll cases;
fingers['c'] = {false, true, true, true, false, false, true, true, true, true};
fingers['d'] = {false, true, true, true, false, false, true, true, true, false};
fingers['e'] = {false, true, true, true, false, false, true, true, false, false};
fingers['f'] = {false, true, true, true, false, false, true, false, false, false};
fingers['g'] = {false, true, true, true, false, false, false, false, false, false};
fingers['a'] = {false, true, true, false, false, false, false, false, false, false};
fingers['b'] = {false, true, false, false, false, false, false, false, false, false};
fingers['C'] = {false, false, true, false, false, false, false, false, false, false};
fingers['D'] = {true, true, true, true, false, false, true, true, true, false};
fingers['E'] = {true, true, true, true, false, false, true, true, false, false};
fingers['F'] = {true, true, true, true, false, false, true, false, false, false};
fingers['G'] = {true, true, true, true, false, false, false, false, false, false};
fingers['A'] = {true, true, true, false, false, false, false, false, false, false};
fingers['B'] = {true, true, false, false, false, false, false, false, false, false};
fingers[' '] = {false, false, false, false, false, false, false, false};
cin >> cases;
cin.ignore();
for(i = 0; i < cases; i++)
{
moves = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
lastFingers = {false, false, false, false, false, false, false, false, false, false};
getline(cin, song);
for(auto note : song)
{
for(j = 0; j < 10; j++)
{
if(fingers[note][j] && !lastFingers[j])
{
moves[j]++;
}
lastFingers[j] = fingers[note][j];
}
}
for(auto element : moves)
{
cout << element << " ";
}
cout << "\n";
}
return 0;
}