QOJ.ac

QOJ

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

Judging History

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

  • [2023-09-16 11:10:19]
  • 评测
  • 测评结果:100
  • 用时:68ms
  • 内存:3752kb
  • [2023-09-16 11:10:18]
  • 提交

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 {
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 + 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: 68ms
memory: 3752kb

input:

10000000
846049473 226486539 715446580 401943166 486882495 791765058 800946334 997572520 551692682 172184423 405358920 565503145 824765549 820934031 143545581 249514572 346698819 636260809 761407314 314495542 786110786 876677860 540199099 538120773 501351843 308560165 290017159 183609164 209161193 3...

output:

5497799990913711

result:

points 1.0 input test passed

Subtask #2:

score: 0
Skipped