QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#180721#1. I/O Test5ab100 89ms3752kbC++201.2kb2023-09-16 10:50:482023-09-16 10:50:49

Judging History

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

  • [2023-09-16 10:50:49]
  • 评测
  • 测评结果:100
  • 用时:89ms
  • 内存:3752kb
  • [2023-09-16 10:50:48]
  • 提交

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 = 20;

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

input:

10000000
156584141 972521836 218986697 729075319 686476406 183718925 487496079 501006038 489065592 241648024 217063114 461580328 211150687 460718149 320994570 365244211 547410185 197930922 876170020 647276550 232904400 399106048 859751595 673884288 203488881 396374140 474256364 389945436 199257449 3...

output:

5499704040756043

result:

points 1.0 input test passed

Subtask #2:

score: 0
Skipped