QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#716351 | #1. I/O Test | BINYU | 200 ✓ | 88ms | 5944kb | C++14 | 4.4kb | 2024-11-06 15:00:02 | 2024-11-06 15:00:02 |
Judging History
config.txt
10000000 10000000
input_test
#include<bits/stdc++.h>
using namespace std;
struct IO {
static const int inSZ = 1 << 17;
char inBuf[inSZ], *in1, *in2;
template<class T> inline __attribute((always_inline))
T read() {
if (in1 > inBuf + inSZ - 32) [[unlikely]] {
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;
}
T res = 0;
unsigned char c;
bool neg = 0;
while ((c = *in1++) < 48) neg = c == 45;
while (res = res * 10 + (c - 48), (c = *in1++) >= 48);
return neg ? -res : res;
}
static const int outSZ = 1 << 21;
char outBuf[outSZ], *out;
template<class T> inline __attribute((always_inline))
void write(T x) {
if (out > outBuf + outSZ - 32) [[unlikely]]
{
fwrite(outBuf, 1, out - outBuf, stdout), out = outBuf;
}
if (!x) return *out++ = 48, void();
if (x < 0) *out++ = 45, x = -x;
alignas(2) const char* digits =
"0001020304050607080910111213141516171819"
"2021222324252627282930313233343536373839"
"4041424344454647484950515253545556575859"
"6061626364656667686970717273747576777879"
"8081828384858687888990919293949596979899";
alignas(64) static char buf[20];
char* p = buf + 20;
while (x >= 10) memcpy(p -= 2, digits + x % 100 * 2, 2), x /= 100;
if (x) *--p = 48 + x;
auto len = buf + 20 - p;
memcpy(out, p, len), out += len;
}
void init() {
in1 = in2 = inBuf + inSZ;
out = outBuf;
}
~IO() { fwrite(outBuf, 1, out - outBuf, stdout); }
} IO;
template<class T = int> inline T read() {
return IO.read<T>();
}
template<class T> inline void print(T x, char c) {
IO.write(x), *IO.out++ = c;
}
template<class T> inline void print(T x) {
IO.write(x);
}
inline __attribute((always_inline)) void printCh(char c) {
*IO.out++ = c;
}
const int N = 1.5e7;
long long s;
int main()
{
IO.init();
int n = read();
while(n--)s += read();
print(s);
}
output_test
#include<bits/stdc++.h>
using namespace std;
struct IO {
static const int inSZ = 1 << 17;
char inBuf[inSZ], *in1, *in2;
template<class T> inline __attribute((always_inline))
T read() {
if (in1 > inBuf + inSZ - 32) [[unlikely]] {
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;
}
T res = 0;
unsigned char c;
bool neg = 0;
while ((c = *in1++) < 48) neg = c == 45;
while (res = res * 10 + (c - 48), (c = *in1++) >= 48);
return neg ? -res : res;
}
static const int outSZ = 1 << 21;
char outBuf[outSZ], *out;
template<class T> inline __attribute((always_inline))
void write(T x) {
if (out > outBuf + outSZ - 32) [[unlikely]]
{
fwrite(outBuf, 1, out - outBuf, stdout), out = outBuf;
}
if (!x) return *out++ = 48, void();
if (x < 0) *out++ = 45, x = -x;
alignas(2) const char* digits =
"0001020304050607080910111213141516171819"
"2021222324252627282930313233343536373839"
"4041424344454647484950515253545556575859"
"6061626364656667686970717273747576777879"
"8081828384858687888990919293949596979899";
alignas(64) static char buf[20];
char* p = buf + 20;
while (x >= 10) memcpy(p -= 2, digits + x % 100 * 2, 2), x /= 100;
if (x) *--p = 48 + x;
auto len = buf + 20 - p;
memcpy(out, p, len), out += len;
}
void init() {
in1 = in2 = inBuf + inSZ;
out = outBuf;
}
~IO() { fwrite(outBuf, 1, out - outBuf, stdout); }
} IO;
template<class T = int> inline T read() {
return IO.read<T>();
}
template<class T> inline void print(T x, char c) {
IO.write(x), *IO.out++ = c;
}
template<class T> inline void print(T x) {
IO.write(x);
}
inline __attribute((always_inline)) void printCh(char c) {
*IO.out++ = c;
}
const int N = 1.5e7;
int a[N + 5];
int main()
{
IO.init();
int n = read();
for(int i = n;i;i--)print(100000000,' ');
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 100
Accepted
Test #1:
score: 100
Accepted
time: 56ms
memory: 3804kb
input:
10000000 919873861 666905041 923798579 309867707 848738851 203692212 594125421 796897755 976439214 630663914 709376456 664160357 719663155 379230879 849531863 570634906 263461058 618569650 207247712 374329076 455323734 167363691 876483026 876166808 252129694 775676077 916169687 761203938 667570047 8...
output:
5499870398007951
result:
points 1.0 input test passed
Subtask #2:
score: 100
Accepted
Test #2:
score: 100
Accepted
time: 88ms
memory: 5944kb
input:
10000000
output:
100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 ...
result:
points 1.0 output test passed