QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180725#1. I/O Test5ab100 61ms3780kbC++201.1kb2023-09-16 10:53:372023-09-16 10:53:37

Judging History

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

  • [2023-09-16 10:53:37]
  • 评测
  • 测评结果:100
  • 用时:61ms
  • 内存:3780kb
  • [2023-09-16 10:53:37]
  • 提交

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();
	x = c & 15;
	while ((c = get_next()) >= '0')
		x = x * 10 + (c & 15);
}
}

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: 61ms
memory: 3780kb

input:

10000000
806522175 644618631 422793429 239965997 860530079 985178443 600895999 670217711 602008631 566623674 723158979 729334586 734759186 334221598 157516250 229269240 747067178 446968096 484928278 203766904 163730342 566541853 243955927 950559944 416227302 131431121 722512967 546006343 168679752 9...

output:

5499377084662883

result:

points 1.0 input test passed

Subtask #2:

score: 0
Skipped