社区讨论
WA on #17 求助
P10815【模板】快速读入参与者 2已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @mdmu9oaf
- 此快照首次捕获于
- 2025/07/28 16:21 7 个月前
- 此快照最后确认于
- 2025/11/04 03:35 4 个月前
CPP
#include<bits/stdc++.h>
using namespace std;
namespace FastIO {
char buf[1 << 21], *p1 = buf, *p2 = buf, obuf[1 << 21], *p3 = obuf;
#define getchar() (p1 == p2 && (p1 = buf, p2 = (p1 + fread(buf, 1, 1 << 21, stdin))) == p1 ? EOF : *p1++)
#define putchar(x) ((p3 - obuf < (1 << 21)) ? (*p3++ = x) : (fwrite(obuf, p3 - obuf, 1, stdout), p3 = obuf, *p3++ = x))
#define outbuf() fwrite(obuf, p3 - obuf, 1, stdout), p3 = obuf;
template <typename T> inline T read(T& t){T x = 0, w = 0; char ch = getchar(); while(!isdigit(ch)) w |= (ch == '-'), ch = getchar(); while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar(); return t = w ? -x : x;}
template <typename T> inline T read(){T x = 0, w = 0; char ch = getchar(); while(!isdigit(ch)) w |= (ch == '-'), ch = getchar(); while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar(); return w ? -x : x;}
template <typename T> inline void write(T x){if (!x) return; write<T>(x / 10), putchar((x % 10) ^ '0'); }
template <typename T> inline void print(T x){if (x > 0) write<T>(x); else if (x < 0) putchar('-'), write<T>(-x); else putchar('0');}
template <typename T> inline void print(T x, char en){print<T>(x), putchar(en);}
}; using namespace FastIO;
//_________________________________________________________________________________________________________________________________________
int n, ans;
int main(){
read<int>(n);
while(n--){
ans += read<int>();
}
print<int>(ans, '\n');
outbuf();
return 0;
}
回复
共 2 条回复,欢迎继续交流。
正在加载回复...