QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180747#1. I/O Test5ab100 66ms3752kbC++201.2kb2023-09-16 11:16:222023-09-16 11:16:23

Judging History

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

  • [2023-09-16 11:16:23]
  • 评测
  • 测评结果:100
  • 用时:66ms
  • 内存:3752kb
  • [2023-09-16 11:16:22]
  • 提交

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: 66ms
memory: 3752kb

input:

10000000
110245649 843834338 201290464 195145414 674515253 602538105 836518794 312757486 962865662 415113965 635803696 951692343 767129720 282881357 807306164 976725817 196910038 106202792 417166598 456776804 620368232 226017586 372445883 607236096 964187420 802534613 119720631 761668891 266285293 3...

output:

5498672793847945

result:

points 1.0 input test passed

Subtask #2:

score: 0
Skipped