QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#180722 | #1. I/O Test | 5ab | 100 | 99ms | 3684kb | C++20 | 1.2kb | 2023-09-16 10:51:31 | 2023-09-16 10:51:32 |
Judging History
config.txt
10000000 0
input_test
#include <iostream>
#include <cstring>
using namespace std;
static constexpr size_t buf_size = 1 << 18;
static constexpr size_t integer_size = 10;
static char inbuf[buf_size + 1] = {};
namespace {
size_t pos, end;
void load() {
end = cin.readsome(inbuf, buf_size);
inbuf[end] = '\0';
}
void reload() {
size_t len = end - pos;
memmove(inbuf, inbuf + pos, len);
end = len + cin.readsome(inbuf + len, buf_size - len);
inbuf[end] = '\0';
pos = 0;
}
void skip_space() {
while (inbuf[pos] <= ' ') {
if (__builtin_expect(++pos == end, 0))
reload();
}
}
char get_next() { return inbuf[pos++]; }
char get_next_nonspace() {
skip_space();
return inbuf[pos++];
}
template<class T>
void scan(T &x) {
char c = get_next_nonspace();
if (__builtin_expect(pos + integer_size >= end, 0))
reload();
bool neg = false;
if (c == '-')
neg = true, x = 0;
else
x = c & 15;
while ((c = get_next()) >= '0')
x = x * 10 + (c & 15);
if (neg)
x = -x;
}
}
int main()
{
cin.tie(0)->sync_with_stdio(0);
int x, y;
long long res = 0;
load();
scan(x);
while (x--)
{
scan(y);
res += y;
}
cout << res << "\n";
return 0;
}
output_test
详细
Subtask #1:
score: 100
Accepted
Test #1:
score: 100
Accepted
time: 99ms
memory: 3684kb
input:
10000000 101988319 789338526 942089933 171592575 418894967 846153794 564915779 920938071 310202164 287891320 409387508 239967889 791088970 608058357 662426672 809580897 867647325 459914064 204768572 873114900 837633346 743879144 385781172 974002753 907850473 404204567 184870084 779919458 186964412 8...
output:
5500623787968084
result:
points 1.0 input test passed
Subtask #2:
score: 0
Skipped