QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#761718#1. I/O Testwly09200 ✓242ms2324kbC++202.1kb2024-11-19 09:30:522024-11-19 09:30:53

Judging History

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

  • [2024-11-19 09:30:53]
  • 评测
  • 测评结果:200
  • 用时:242ms
  • 内存:2324kb
  • [2024-11-19 09:30:52]
  • 提交

config.txt

10000000 10000000

input_test

#include <cstdint>
#include <cstdio>

#define MYBUF (1 << 20)
char buf[MYBUF], *p1, *p2;
#define gc()                                                                   \
  (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MYBUF, stdin), p1 == p2)       \
       ? EOF                                                                   \
       : *p1++)
inline int64_t rd() {
  int64_t x = 0;
  char c = gc();
  while (c < '0' || c > '9')
    c = gc();
  for (; c >= '0' && c <= '9'; c = gc())
    x = x * 10 + (c ^ '0');
  return x;
}
char pbuf[MYBUF], *pp = pbuf;
void pc(const char &c) {
  if (pp - pbuf == MYBUF)
    fwrite(pbuf, 1, MYBUF, stdout), pp = pbuf;
  *pp++ = c;
}
void wt(int64_t x) {
  static int sta[35];
  int top = 0;
  do {
    sta[top++] = x % 10, x /= 10;
  } while (x);
  while (top)
    pc(sta[--top] + '0');
}
#undef MYBUF

int main() {
  int64_t n = rd();
  int64_t sum = 0;
  while (n--) {
    int64_t x = rd();
    sum += x;
  }
  wt(sum);
  return fwrite(pbuf, 1, pp - pbuf, stdout), 0;
}

output_test

#include <cstdint>
#include <cstdio>

#define MYBUF (1 << 20)
char buf[MYBUF], *p1, *p2;
#define gc()                                                                   \
  (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, MYBUF, stdin), p1 == p2)       \
       ? EOF                                                                   \
       : *p1++)
inline int64_t rd() {
  int64_t x = 0;
  char c = gc();
  while (c < '0' || c > '9')
    c = gc();
  for (; c >= '0' && c <= '9'; c = gc())
    x = x * 10 + (c ^ '0');
  return x;
}
char pbuf[MYBUF], *pp = pbuf;
void pc(const char &c) {
  if (pp - pbuf == MYBUF)
    fwrite(pbuf, 1, MYBUF, stdout), pp = pbuf;
  *pp++ = c;
}
void wt(int64_t x) {
  static int sta[35];
  int top = 0;
  do {
    sta[top++] = x % 10, x /= 10;
  } while (x);
  while (top)
    pc(sta[--top] + '0');
}
#undef MYBUF

const int64_t ST = 1e8 + 3;

int main() {
  int64_t n = rd();
  while (n--)
    wt(ST + n), pc(' ');
  return fwrite(pbuf, 1, pp - pbuf, stdout), 0;
}

详细

Subtask #1:

score: 100
Accepted

Test #1:

score: 100
Accepted
time: 68ms
memory: 2324kb

input:

10000000
839633994 584885528 594490808 531376478 516361554 102051542 349212236 483870674 162832087 220698041 965653926 478914239 932316004 197105461 246465911 675274397 790703744 857002921 714049869 728852823 961480593 518727339 997421300 888624038 383733424 626237132 715406970 886196073 894346523 5...

output:

5500358914237556

result:

points 1.0 input test passed

Subtask #2:

score: 100
Accepted

Test #2:

score: 100
Accepted
time: 242ms
memory: 2300kb

input:

10000000

output:

110000002 110000001 110000000 109999999 109999998 109999997 109999996 109999995 109999994 109999993 109999992 109999991 109999990 109999989 109999988 109999987 109999986 109999985 109999984 109999983 109999982 109999981 109999980 109999979 109999978 109999977 109999976 109999975 109999974 109999973 ...

result:

points 1.0 output test passed