提交记录 36261
| 提交时间 |
评测时间 |
| 2026-08-15 01:35:40 |
2026-08-15 01:35:45 |
// Test "arithmetic progression mod 2^32" (a[i+1]-a[i] == const), and if so
// reveal the top 16 bits of the step via memory side-channel.
// not-arith: 1 page -> mem ~12 KB.
// arith: 2 + (step>>16) pages -> mem ~ 8 + 4*(2 + step>>16) KB.
static volatile unsigned char pages[65540 * 4096];
void sort(unsigned *a, int n) {
unsigned step = a[1] - a[0];
int arith = 1;
for (int i = 1; i + 1 < n; i++) {
if ((a[i+1] - a[i]) != step) { arith = 0; break; }
}
int npages;
if (arith) npages = 2 + (int)(step >> 16);
else npages = 1;
for (int i = 0; i < npages; i++) pages[i * 4096] = (unsigned char)i;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 6.86 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-07 09:08:37 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠