提交记录 3270
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| wys | noi17a. 【NOI2017】整数 | Time Limit Exceeded | 60 | 2 s | 3776 KB | C++ | 1.28 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2018-07-11 02:06:52 | 2020-07-31 21:14:41 |
// integer naive.cpp by wys @2017-06-24
#include <stdio.h>
#include <stdint.h>
const int MAXN = 1000005;
const int MAXM = MAXN * 30;
const int MAXLEN = MAXM / 32;
uint32_t A[MAXLEN];
void _add1(int p) {
while (A[p] == ~0u) {
A[p++] = 0;
}
++A[p];
}
void _sub1(int p) {
while (A[p] == 0) {
A[p++] = ~0u;
}
--A[p];
}
void _add(int pos, uint32_t val) {
if ((A[pos] += val) < val) {
_add1(pos + 1);
}
}
void _sub(int pos, uint32_t val) {
if (A[pos] < val) {
_sub1(pos + 1);
}
A[pos] -= val;
}
void add(int _a, int b) {
if (_a == 0) return;
bool neg = _a < 0;
uint32_t a = neg ? -_a : _a;
// b/32, b%32, 32-b%32, b/32+1, 0, b%32
int pos = b >> 5;
int off = b & 31;
int len1 = 32 - off;
// log(1e9) = 30
uint32_t part1 = len1 >= 30 ? a : (a & ((1u << len1) - 1));
uint32_t part2 = len1 >= 30 ? 0 : (a >> len1);
if (part1) (neg ? _sub : _add)(pos, part1 << off);
if (part2) (neg ? _sub : _add)(pos + 1, part2);
}
int query(int k) {
return ((A[k >> 5]) >> (k & 31)) & 1u;
}
int main() {
int n, t1, t2, t3;
scanf("%d%d%d%d", &n, &t1, &t2, &t3);
for (int i = 0; i < n; i++) {
int op, a, b, k;
scanf("%d", &op);
if (op == 1) {
scanf("%d%d", &a, &b);
add(a, b);
} else {
scanf("%d", &k);
putchar("01"[query(k)]);
putchar('\n');
}
}
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 8.69 us | 20 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #2 | 26.48 us | 20 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #3 | 213.41 us | 20 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #4 | 376.43 us | 20 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #5 | 879.81 us | 20 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #6 | 929.52 us | 24 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #7 | 18.707 ms | 56 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #8 | 1.619 ms | 24 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #9 | 198.364 ms | 144 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #10 | 684.148 ms | 224 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #11 | 32.092 ms | 64 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #12 | 465.577 ms | 292 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #13 | 993.615 ms | 316 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #14 | 2 s | 780 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #15 | 2 s | 1 MB + 136 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #16 | 2 s | 1 MB + 504 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #17 | 1.867 s | 376 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #18 | 2 s | 2 MB + 228 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #19 | 2 s | 2 MB + 604 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #20 | 88.141 ms | 3 MB + 656 KB | Accepted | Score: 4 | 显示更多 |
| Testcase #21 | 2 s | 3 MB + 336 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #22 | 2 s | 308 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #23 | 2 s | 3 MB + 460 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #24 | 2 s | 304 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #25 | 2 s | 3 MB + 704 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-18 21:57:43 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠