QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#60776 | #1. I/O Test | platelet | 200 ✓ | 90ms | 3224kb | C++11 | 1.2kb | 2022-11-07 12:39:02 | 2022-11-07 12:39:05 |
Judging History
config.txt
10000000 10000000
input_test
#include <cstring>
#include <cstdio>
const int inSZ = 1 << 17;
unsigned char inBuf[inSZ], *in1, *in2;
inline __attribute((always_inline))
unsigned read() {
unsigned res = 0;
unsigned char c = *in1++;
while(res = res * 10 + c - 48, (c = *in1++) >= 48);
return res;
}
inline __attribute((always_inline))
void refresh() {
if(__builtin_expect(in1 > inBuf + inSZ - 128, 0)) {
auto len = in2 - in1;
memcpy(inBuf, in1, len);
in1 = inBuf, in2 = inBuf + len;
in2 += fread(in2, 1, inSZ - len, stdin);
if(in2 != inBuf + inSZ) *in2 = 0;
}
}
int main() {
in1 = inBuf;
in2 = in1 + fread(in1, 1, inSZ, stdin);
read();
unsigned long sum = 0;
for(int i = 0; i < 1000000; i++) {
#pragma GCC unroll 10
for(int j = 0; j < 10; j++) sum += read();
refresh();
}
printf("%lu\n", sum);
}
output_test
#include <cstring>
#include <cstdio>
const int outSZ = 2e6;
unsigned char outBuf[outSZ];
int main() {
memset(outBuf, '9', outSZ);
for(int i = 9; i < outSZ; i += 10) outBuf[i] = ' ';
for(int i = 50; i; i--) fwrite(outBuf, 1, outSZ, stdout);
}
詳細信息
Subtask #1:
score: 100
Accepted
Test #1:
score: 100
Accepted
time: 90ms
memory: 1616kb
input:
10000000 526754959 914469261 195936522 492955374 366132489 339675899 503135046 903044944 464819382 806168390 582066793 342616554 477063222 419063905 833408636 901790859 796930691 351178954 985215311 167125368 318996691 872934240 342241951 650333174 519144230 728578499 734374184 621510956 790831986 4...
output:
5499625790634770
result:
points 1.0 input test passed
Subtask #2:
score: 100
Accepted
Test #2:
score: 100
Accepted
time: 4ms
memory: 3224kb
input:
10000000
output:
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999 ...
result:
points 1.0 output test passed