提交记录 16116


用户 题目 状态 得分 用时 内存 语言 代码长度
Alphagocc mmmd1k. 测测你的双精度矩阵乘法-1k Accepted 100 742.787 ms 8200 KB C++ 762 B
提交时间 评测时间
2021-03-27 13:16:28 2021-03-27 13:16:34
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline",  \
    "-ftree-vectorize", "-fopt-info-vec-all")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("sse,sse2,sse3,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2")
#define idx(i, j) ((i) * n + (j))

void matrix_multiply(int n, const double *A, const double *B, double *C) {
	for (int k = 0; k < n; ++k) {
        for (int i = 0; i < n; ++i) {
            double r = A[idx(i,k)];
            for (int j = 0; j < n; j += 4) {
                C[idx(i,j)] += r * B[idx(k,j)];
                C[idx(i,j+1)] += r * B[idx(k,j+1)];
                C[idx(i,j+2)] += r * B[idx(k,j+2)];
                C[idx(i,j+3)] += r * B[idx(k,j+3)];
            }
        }
    }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1742.787 ms8 MB + 8 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-10-05 10:32:09 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用