提交记录 10862
| 提交时间 |
评测时间 |
| 2019-10-06 18:28:44 |
2020-08-01 02:34:38 |
#include "router.h"
#include <cstdio>
int n;
const RoutingTableEntry *a;
void init(int _n, int _q, const RoutingTableEntry *_a)
{
n = _n, a = _a;
}
unsigned query(unsigned addr)
{
unsigned table_addr = 0;
unsigned nexthop = 0;
unsigned char len = 0;
for (int i = n; i--;)
if (a[i].len > len && ((addr ^ a[i].addr) & -(1 << 32 - a[i].len)) == 0)
{
nexthop = a[i].nexthop, len = a[i].len;
table_addr = a[i].addr;
}
// printip("table_addr", table_addr);
// printf("len = %d\n", len);
return nexthop;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 12.22 us | 24 KB | Accepted | Score: 25 | 显示更多 |
| Testcase #2 | 3.35 ms | 9 MB + 500 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 30 s | 9 MB + 496 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #4 | 30 s | 9 MB + 496 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-28 19:59:36 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠