QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#189006#1. I/O Test5ab200 ✓88ms98916kbC++201.7kb2023-09-26 18:50:362023-09-26 18:50:38

Judging History

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

  • [2023-09-26 18:50:38]
  • 评测
  • 测评结果:200
  • 用时:88ms
  • 内存:98916kb
  • [2023-09-26 18:50:36]
  • 提交

config.txt

10000000 10000000

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 {
int pos, end;

void load() {
	pos = 0;
	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 = 1e7, y;
	long long res = 0;
	
	load();
	scan(x);
	while (x--)
	{
		scan(y);
		res += y;
		// res ^= y;
	}
	cout << res << "\n";
	
	return 0;
}

output_test

/* name: out
 * author: 5ab
 * created at: 2023-09-26
 */
#include <cstdio>
using namespace std;

constexpr int obuf = 1e8 + 1;

char s[obuf + 1];

signed main()
{
	int n = 1e7, p = 0;
	
	while (n--)
	{
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = '1';
		s[p++] = ' ';
	}
	fwrite(s, 1, p, stdout);
	
	return 0;
}
// started coding at: 09-26 18:32:36

詳細信息

Subtask #1:

score: 100
Accepted

Test #1:

score: 100
Accepted
time: 88ms
memory: 3784kb

input:

10000000
145799794 916883774 959490498 974161991 834944666 930191658 148748920 757873575 846220222 807393890 283243551 415913261 346493867 131905274 996462188 996825943 307606579 687368348 916628624 938601848 384667593 545362157 514177629 875256407 531809390 816576025 409350181 870289000 376218978 6...

output:

5500630673553277

result:

points 1.0 input test passed

Subtask #2:

score: 100
Accepted

Test #2:

score: 100
Accepted
time: 11ms
memory: 98916kb

input:

10000000

output:

111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 111111111 ...

result:

points 1.0 output test passed