提交记录 27573
提交时间 |
评测时间 |
2024-12-27 17:23:48 |
2024-12-27 17:23:51 |
unsigned solve(int n, char *s) {
unsigned int A[1000000] = {};
unsigned int p = 1000001;
A[500000] = 1;
int i = 0;
while (1) {
switch (s[i++]) {
case 0: goto end;
case '(': --p; break;
case ')': A[++p/2-1] = 0; break;
case '?':
unsigned* B = --p/2 + A;
int m = 266670 - i;
if (m>i) m=i;
m /= 2;
for (int j=0; j<m; j+=16) {
asm volatile(
"vmovupd 4(%0), %%ymm0; vmovupd 36(%0), %%ymm1;"
"vmovupd 0(%0), %%ymm2; vmovupd 32(%0), %%ymm3;"
"vpaddd %%ymm2, %%ymm0, %%ymm2; vpaddd %%ymm3, %%ymm1, %%ymm3;"
"vmovupd %%ymm2, 0(%0); vmovupd %%ymm3, 32(%0);"
: : "r"(B+j): "memory");
}
} //printf("%d %d | %d %d %d %d\n", A[p/2-2], A[p/2-1], A[p/2], A[p/2+1], A[p/2+2], A[p/2+3]);
} end:;
return A[p/2];
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 404.88 us | 3 MB + 852 KB | Accepted | Score: 25 | 显示更多 |
Testcase #2 | 270.93 ms | 3 MB + 968 KB | Accepted | Score: 25 | 显示更多 |
Testcase #3 | 637.417 ms | 4 MB + 48 KB | Accepted | Score: 25 | 显示更多 |
Testcase #4 | 670.191 ms | 4 MB + 88 KB | Accepted | Score: 25 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-01-19 02:30:57 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠