QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#42559 | #1. I/O Test | Qingyu | 200 ✓ | 209ms | 17008kb | C++23 | 2.3kb | 2022-08-02 17:46:34 | 2022-08-02 17:46:39 |
Judging History
config.txt
10000000 10000000
input_test
#include <bits/stdc++.h>
template<int T>
struct fast_io {
char p[T], *p1, *p2, q[T], *q1, *q2;
fast_io() {
p1 = p2 = p;
q1 = q;
q2 = q + T;
}
inline char gc() {
return p1 == p2 && (p2 = (p1 = p) + fread(p, 1, T, stdin), p1 == p2) ? EOF : *p1++;
}
inline void pc(char ch) {
if (q1 == q2) {
fwrite(q, 1, T, stdout);
q1 = q;
}
*q1++ = ch;
}
~fast_io() {
fwrite(q, 1, q1 - q, stdout);
}
};
fast_io<12'345'678> io;
inline int read() {
int r = 0, neg = 1;
char ch;
do {
ch = io.gc();
if (ch == '-')
neg = -1;
} while (ch < 48 || ch > 57);
do r = r * 10 + ch - 48, ch = io.gc(); while (ch >= 48 && ch <= 57);
return r * neg;
}
inline void write(int x) {
if (x < 0) io.pc('-'), x = -x;
if (x >= 10) write(x / 10);
io.pc(48 + x % 10);
}
inline void output(int x, char ch = ' ') {
write(x);
io.pc(ch);
}
void input_test() {
int n = read();
long long sum = 0, x;
for (int i = 1; i <= n; ++i) {
x = read();
sum += x;
}
std::cout << sum << '\n';
}
void output_test() {
int n = read();
for (int i = 0; i < n; ++i)
output(2e8);
}
int main() {
input_test();
}
output_test
#include <bits/stdc++.h>
template<int T>
struct fast_io {
char p[T], *p1, *p2, q[T], *q1, *q2;
fast_io() {
p1 = p2 = p;
q1 = q;
q2 = q + T;
}
inline char gc() {
return p1 == p2 && (p2 = (p1 = p) + fread(p, 1, T, stdin), p1 == p2) ? EOF : *p1++;
}
inline void pc(char ch) {
if (q1 == q2) {
fwrite(q, 1, T, stdout);
q1 = q;
}
*q1++ = ch;
}
~fast_io() {
fwrite(q, 1, q1 - q, stdout);
}
};
fast_io<12'345'678> io;
inline int read() {
int r = 0, neg = 1;
char ch;
do {
ch = io.gc();
if (ch == '-')
neg = -1;
} while (ch < 48 || ch > 57);
do r = r * 10 + ch - 48, ch = io.gc(); while (ch >= 48 && ch <= 57);
return r * neg;
}
inline void write(int x) {
if (x < 0) io.pc('-'), x = -x;
if (x >= 10) write(x / 10);
io.pc(48 + x % 10);
}
inline void output(int x, char ch = ' ') {
write(x);
io.pc(ch);
}
void input_test() {
int n = read();
long long sum = 0, x;
for (int i = 1; i <= n; ++i) {
x = read();
sum += x;
}
std::cout << sum << '\n';
}
void output_test() {
int n = read();
for (int i = 0; i < n; ++i)
output(2e8);
}
int main() {
output_test();
}
詳細信息
Subtask #1:
score: 100
Accepted
Test #1:
score: 100
Accepted
time: 117ms
memory: 15884kb
input:
10000000 821580138 346332289 652007172 147730935 184732645 256821839 168984499 541762571 436446072 860533807 900007391 584795548 560252242 760573220 241050881 435237432 573794024 781495589 950128988 318066654 375242156 359971300 153474927 748051855 463587558 994695887 165211484 886971192 970344412 7...
output:
5497957224557130
result:
points 1.0 input test passed
Subtask #2:
score: 100
Accepted
Test #2:
score: 100
Accepted
time: 209ms
memory: 17008kb
input:
10000000
output:
200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 200000000 ...
result:
points 1.0 output test passed