图普科技2018届秋招在线笔试 register

Ended

Participants:463

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-15 12:57:00

Lang:G++

Edit
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
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<cmath>
#include<set>
using namespace std;
typedef long long LL;
typedef unsigned int uint;
float image[36][36][3];
float w[5][5][3][8];
float b[8];
float output[16][16][8];
void convolution() {
    // filter
    for (int f = 0; f < 8; f++) {
        // output coordinate
        for (int x = 0; x < 16; x++)
            for (int y = 0; y < 16; y++) {
                // input coordinate
                output[x][y][f] = b[f];
                for (int i = 0; i < 5; i++)
                    for (int j = 0; j < 5; j++)
                        for (int c = 0; c < 3; c++) 
                            output[x][y][f] += image[2*x + i+1][2*y + j+1][c] * w[i][j][c][f];
                if (output[x][y][f] < 0)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX