提交记录 10836


用户 题目 状态 得分 用时 内存 语言 代码长度
ta123 router32. 测测你的路由器 Compile Error 0 0 ns 0 KB C++ 325 B
提交时间 评测时间
2019-10-04 22:36:33 2020-08-01 02:31:06
#include "router.h"

void init(int n, int q, const RoutingTableEntry *a) {	
}

unsigned query(unsigned addr) {
    unsigned nextop;
    unsigned char len = 0;
    for (int i = n; i--;)
        if (((addr ^ a[i].addr) & (1 << a[i].len) - 1) == 0 && a[i].len > len)
            ans = a[i].nextop, len = a[i].len;
	return ans;
}

CompilationN/AN/ACompile ErrorScore: N/A


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-28 20:38:18 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠