QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#180748 | #1. I/O Test | 5ab | 100 | 48ms | 3924kb | C++20 | 1.2kb | 2023-09-16 11:16:48 | 2023-09-16 11:16:50 |
Judging History
config.txt
10000000 0
input_test
#include <iostream>
#include <cstring>
#include <limits>
using namespace std;
static constexpr size_t buf_size = 1 << 18;
static char inbuf[buf_size + 1] = {};
namespace {
char *pos, *end;
void load() {
pos = inbuf;
end = inbuf + cin.readsome(inbuf, buf_size);
*end = '\0';
}
void reload() {
size_t len = end - pos;
memmove(inbuf, pos, len);
end = inbuf + len + cin.readsome(inbuf + len, buf_size - len);
*end = '\0';
pos = inbuf;
}
void skip_space() {
while (*pos <= ' ') {
if (__builtin_expect(++pos == end, 0))
reload();
}
}
char get_next() { return *(pos++); }
char get_next_nonspace() {
skip_space();
return *(pos++);
}
template<class T>
void scan(T &x) {
char c = get_next_nonspace();
if (__builtin_expect(pos + numeric_limits<T>::digits10 + 1 >= 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: 48ms
memory: 3924kb
input:
10000000 256558200 292738391 618856936 558085462 623323789 198762847 956249383 876208387 348655562 853508129 592471483 102911010 549941765 210486709 429987292 334584963 484547820 289245858 668046534 970150417 607223892 660656206 698161872 622629624 841089162 731103010 667734247 214669635 870600314 5...
output:
5499883072738942
result:
points 1.0 input test passed
Subtask #2:
score: 0
Skipped