提交记录 16413
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| kai586123 | noip18f. 【NOIP2018】保卫王国 | Time Limit Exceeded | 0 | 2 s | 456168 KB | C++11 | 1.50 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2021-08-06 20:02:07 | 2021-08-06 20:02:55 |
#include <bits/stdc++.h>
namespace GenHelper
{
unsigned z1,z2,z3,z4,b;
inline unsigned rand_()
{
b=((z1<<6)^z1)>>13;
z1=((z1&4294967294U)<<18)^b;
b=((z2<<2)^z2)>>27;
z2=((z2&4294967288U)<<2)^b;
b=((z3<<13)^z3)>>21;
z3=((z3&4294967280U)<<7)^b;
b=((z4<<3)^z4)>>12;
z4=((z4&4294967168U)<<13)^b;
return (z1^z2^z3^z4);
}
}
inline void srand(unsigned x)
{using namespace GenHelper;
z1=x; z2=(~x)^0x233333333U; z3=x^0x1234598766U; z4=(~x)+51;}
inline int read()
{
using namespace GenHelper;
int a=rand_()&32767;
int b=rand_()&32767;
return a*32768+b;
}
const int N = 2e7 + 233;
int A[N], ls[N], rs[N], stk[N], top, root;
unsigned long long ans[N];
inline void prework(unsigned n) {
for (unsigned i = 1; i <= n; ++i) {
while (top && A[stk[top]] <= A[i])
ls[i] = stk[top--];
rs[stk[top]] = i;
stk[++top] = i;
}
root = stk[1];
}
inline unsigned query(int l, int r) {
for (int x = root; ; x = r < x ? ls[x] : rs[x])
if (l <= x && r >= x)
return A[x];
}
int main() {
unsigned n, m; unsigned s;
// std::cin >> n >> m >> s;
n = 20000000;
m = 20000000;
s = 233;
srand(s);
for (unsigned i = 1; i <= n; ++i)
A[i] = read();
prework(n);
for (unsigned i = 1; i <= m; ++i) {
int l = read() % n + 1, r = read() % n + 1;
unsigned long long tmp = query(l <= r ? l : r, l <= r ? r : l);
ans[i] = tmp;
// printf("%lld\n", ans[i]);
}
for (int i = 1; i <= m; ++i)
printf("%lld\n", ans[i]);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 2 s | 445 MB + 140 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #2 | 2 s | 445 MB + 340 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #3 | 2 s | 445 MB + 40 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #4 | 2 s | 445 MB + 156 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #5 | 2 s | 445 MB + 204 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #6 | 2 s | 445 MB + 128 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #7 | 2 s | 445 MB + 300 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #8 | 2 s | 445 MB + 116 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #9 | 2 s | 445 MB + 144 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #10 | 2 s | 445 MB + 48 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #11 | 2 s | 445 MB + 104 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #12 | 2 s | 445 MB + 44 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #13 | 2 s | 445 MB + 136 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #14 | 2 s | 445 MB + 60 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #15 | 2 s | 445 MB + 8 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #16 | 2 s | 445 MB + 56 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #17 | 2 s | 445 MB + 88 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #18 | 2 s | 445 MB + 128 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #19 | 2 s | 445 MB + 108 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #20 | 2 s | 445 MB + 128 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #21 | 2 s | 445 MB + 64 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #22 | 2 s | 445 MB + 100 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #23 | 2 s | 445 MB + 124 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #24 | 2 s | 445 MB + 148 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #25 | 2 s | 445 MB + 488 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-19 06:19:26 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠