提交记录 18787


用户 题目 状态 得分 用时 内存 语言 代码长度
Minion wc2017b2. 【WC2017】挑战-任务2 Time Limit Exceeded 50 3 s 8336 KB C++11 937 B
提交时间 评测时间
2022-12-14 19:15:18 2022-12-14 19:15:23
#define u32 unsigned
#define u16 unsigned short
#define fo(i,x,y) for(int i = x;i <= y;++i)
u16 b1[300010][3],b2[300010][3],pp[256];
inline char pop(u16 x) {return pp[x >> 8] + pp[x & 255];}
void solve(int n, int q, char *s1, char *s2, int *q_x, int *q_y, int *q_len, u32 *ans)
{
	fo(i,1,255) pp[i] = pp[i >> 1] + (i & 1);
	fo(i,0,n - 1) s1[i] = (s1[i] - 47) % 3,s2[i] -= 48;
	fo(i,0,n - 15) fo(j,0,2) fo(k,0,15) b1[i][j] = b1[i][j] << 1 | (s1[i + k] == j);
	fo(i,0,n - 15) fo(j,0,2) fo(k,0,15) b2[i][j] = b2[i][j] << 1 | (s2[i + k] == j);
	fo(i,0,q - 1)
	{
		int x = q_x[i],y = q_y[i],l = q_len[i];
		ans[i] = 0;
		if(l == 0) continue;
		int J = 0,a1 = 0,a2 = 0,a3 = 0;
		for(int j = 0;j + 17 <= l;j += 16)
		{
			a1 += pop(b1[x + j][0] & b2[y + j][0]);
			a2 += pop(b1[x + j][1] & b2[y + j][1]);
			a3 += pop(b1[x + j][2] & b2[y + j][2]);
			J = j + 16;
		}
		fo(j,J,l - 1) a1 += (s1[x + j] == s2[y + j]);
		ans[i] = a1 + a2 + a3;
	}
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1252.03 us64 KBAcceptedScore: 50

Testcase #23 s8 MB + 144 KBTime Limit ExceededScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2025-09-16 19:01:34 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠