@TaeHunKim/

# algospot.OCR

## No description

Files
• main.cpp
main.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
#include <iostream>
#include <string>
#include <cmath> //log
using namespace std;
int n, m, q;
int R[100];
double T[501][501];
double M[501][501];
int choice[102][502];
double cache[102][502];
string corpus[501];
int main()
{
cin >> n >> q;
for(int i=1; i < n+1; ++i)
cin >> corpus[i];
for(int i=1; i < n+1; ++i)
{
cin >> T[0][i];
T[0][i] = log(T[0][i]);
}
for(int i=1; i < n+1; ++i)
{
for(int j=1; j < n+1; ++j)
{
cin >> T[i][j];
T[i][j] = log(T[i][j]);
}
}
for(int i=1; i < n+1; ++i)
{
for(int j=1; j < n+1; ++j)
{
cin >> M[i][j];
M[i][j] = log(M[i][j]);
}
}
while(q--)
{
// init cache
for (int i = 0; i < 501; ++i)
for (int j = 0; j < 501; ++j)
cache[i][j] = 1.0;
cin >> m;
for(int i=0; i < m; ++i)
{
string word;
cin >> word;
for(int j=1; j < n+1; ++j)
{
if(word == corpus[j])
{
R[i] = j;
break;
}
}
// FILL THIS PART
}
cout << endl;
}
return 0;
}
Fetching token