QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180722#1. I/O Test5ab100 99ms3684kbC++201.2kb2023-09-16 10:51:312023-09-16 10:51:32

Judging History

你现在查看的是最新测评结果

  • [2023-09-16 10:51:32]
  • 评测
  • 测评结果:100
  • 用时:99ms
  • 内存:3684kb
  • [2023-09-16 10:51:31]
  • 提交

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