提交记录 13300


用户 题目 状态 得分 用时 内存 语言 代码长度
return20071007 router32. 测测你的路由器 Wrong Answer 50 974.166 ms 43328 KB C++11 436 B
提交时间 评测时间
2020-08-01 10:04:26 2020-08-01 10:04:30
#include<bits/stdc++.h>
#include<arpa/inet.h>
#include"router.h"
using namespace std;
unordered_map<unsigned,unsigned>hop[33];
void init(int n,int q,const RoutingTableEntry*a){
	for(int i=0;i<n;++i){
		hop[a[i].len][htonl(a[i].addr)]=a[i].nexthop;
	}
}
unsigned query(unsigned addr){
	addr=htonl(addr);
	for(int i=32;~i;--i){
		if(hop[i].find(addr)!=hop[i].end())return hop[i][addr];
		addr&=(unsigned)((1ll<<(32-i))-1);
	}
	return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #138.29 us36 KBAcceptedScore: 25

Testcase #2151.359 ms42 MB + 320 KBAcceptedScore: 25

Testcase #3567.255 ms42 MB + 320 KBWrong AnswerScore: 0

Testcase #4974.166 ms42 MB + 320 KBWrong AnswerScore: 0


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