提交记录 10843


用户 题目 状态 得分 用时 内存 语言 代码长度
ta123 router32. 测测你的路由器 Wrong Answer 25 30 s 9716 KB C++11 397 B
提交时间 评测时间
2019-10-04 22:52:41 2020-08-01 02:32:54
#include "router.h"

int n;
const RoutingTableEntry * a;

void init(int _n, int _q, const RoutingTableEntry * _a) {
    n = _n, a = _a;
}

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

CompilationN/AN/ACompile OKScore: N/A

Testcase #112.03 us24 KBAcceptedScore: 25

Testcase #23.05 ms9 MB + 500 KBWrong AnswerScore: 0

Testcase #330 s9 MB + 496 KBTime Limit ExceededScore: 0

Testcase #430 s9 MB + 496 KBTime Limit ExceededScore: 0


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