提交记录 10260
| 提交时间 |
评测时间 |
| 2019-09-16 23:31:31 |
2020-08-01 02:05:07 |
#include <unordered_map>
#include "router.h"
std::unordered_map<long long, unsigned> M;
void ins(const RoutingTableEntry *e) {
M[1LL*e->len<<32|e->addr] = e->nexthop;
}
void init(int n, int q, const RoutingTableEntry *tbl) {
for (int i = 0; i < n; i++) {
ins(tbl + i);
}
}
unsigned query(unsigned addr) {
for (int i = 32; i >= 0; i--) {
if (M.count(1LL*i<<32|addr)) {
return M[i<<32LL|addr];
}
addr &=~ 1<<(i-1^24);
}
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 13.98 us | 24 KB | Accepted | Score: 25 | 显示更多 |
| Testcase #2 | 194.923 ms | 42 MB + 808 KB | Accepted | Score: 25 | 显示更多 |
| Testcase #3 | 2.24 s | 42 MB + 808 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 4.275 s | 42 MB + 808 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-29 21:48:32 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠