提交记录 10724
| 提交时间 |
评测时间 |
| 2019-09-28 16:14:39 |
2020-08-01 02:20:59 |
//#define Debug
#ifndef Debug
#include "router.h"
#endif
#ifdef Debug
typedef struct {
unsigned addr;
unsigned char len;
char pad[3]; // Padding for memory alignment
unsigned nexthop;
} __attribute__((packed)) RoutingTableEntry;
#endif
#include <cstdlib>
unsigned int ans=-1;
int maxlen=-1;
int n;
int q;
const RoutingTableEntry *a;
void init(int _n, int _q, const RoutingTableEntry *_a) {
n=_n;
q=_q;
a=_a;
}
unsigned query(unsigned addr) {
for (int i=0;i<n;i++){
if ((addr>>(32-int(a[i].len)))==(a[i].addr>>(32-int(a[i].len)))&&(int(a[i].len)>maxlen)){
maxlen=a[i].len;
ans=a[i].nexthop;
}
}
return ans;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 13.15 us | 24 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 3.215 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-29 01:51:23 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠