結果
| 問題 | No.3677 Global Checksum |
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2026-09-03 22:37:19 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 2,051 bytes |
| 記録 | |
| コンパイル時間 | 325 ms |
| コンパイル使用メモリ | 80,324 KB |
| 実行使用メモリ | 9,740 KB |
| 最終ジャッジ日時 | 2026-09-04 23:13:21 |
| 合計ジャッジ時間 | 4,223 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 TLE * 1 -- * 6 |
ソースコード
#include <cstdint>
#include <cstdio>
#include <vector>
using u32 = uint32_t;
class FastInput {
static constexpr size_t BUF_SIZE = 1 << 20;
char buf[BUF_SIZE];
size_t pos = 0, len = 0;
inline char getChar() {
if (pos == len) {
len = std::fread(buf, 1, BUF_SIZE, stdin);
pos = 0;
if (len == 0) return '\0';
}
return buf[pos++];
}
public:
inline u32 readUInt() {
char c = getChar();
while (c < '0' || c > '9') {
c = getChar();
}
u32 x = 0;
do {
x = x * 10 + static_cast<u32>(c - '0');
c = getChar();
} while ('0' <= c && c <= '9');
return x;
}
};
class FastOutput {
static constexpr size_t BUF_SIZE = 1 << 20;
char buf[BUF_SIZE];
size_t pos = 0;
public:
~FastOutput() {
flush();
}
inline void flush() {
if (pos) {
std::fwrite(buf, 1, pos, stdout);
pos = 0;
}
}
inline void writeUInt(u32 x) {
char tmp[10];
int n = 0;
do {
tmp[n++] = static_cast<char>('0' + x % 10);
x /= 10;
} while (x);
if (pos + static_cast<size_t>(n) + 1 > BUF_SIZE) {
flush();
}
while (n--) {
buf[pos++] = tmp[n];
}
buf[pos++] = '\n';
}
};
int main() {
FastInput in;
FastOutput out;
const u32 H = in.readUInt();
const u32 W = in.readUInt();
// S_i を保存する。
// H <= 10^6 なので最大でも約 4 MB。
std::vector<u32> S(H);
u32 T = 0;
for (u32 i = 0; i < H; ++i) {
u32 s = 0;
for (u32 j = 0; j < W; ++j) {
const u32 a = in.readUInt();
s += a; // 自動的に mod 2^32
}
S[i] = s;
T += s; // 自動的に mod 2^32
}
for (u32 i = 0; i < H; ++i) {
const u32 C = S[i] + T; // 自動的に mod 2^32
out.writeUInt(C);
}
return 0;
}
harurun