結果
| 問題 | No.3677 Global Checksum |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-05 01:22:54 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,280 bytes |
| 記録 | |
| コンパイル時間 | 1,122 ms |
| コンパイル使用メモリ | 214,476 KB |
| 実行使用メモリ | 52,264 KB |
| 最終ジャッジ日時 | 2026-09-05 01:23:07 |
| 合計ジャッジ時間 | 4,976 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 1 -- * 7 |
コンパイルメッセージ
main.cpp: In constructor 'FastIn::FastIn()':
main.cpp:8:18: warning: '*this.FastIn::buf' is used uninitialized [-Wuninitialized]
8 | FastIn() {
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <sys/mman.h>
#include <sys/stat.h>
struct FastIn {
char* buf;
char* pos = buf;
FastIn() {
struct stat st;
fstat(0, &st);
buf = (char*)mmap(nullptr, st.st_size, PROT_READ, MAP_PRIVATE, 0, 0);
pos = buf;
}
unsigned int nextNum() {
unsigned int ret = 0;
while (*pos < '0' || *pos > '9') pos++;
while ('0' <= *pos && *pos <= '9') {
ret = ret * 10 + (*pos - '0');
pos++;
}
return ret;
}
} fin;
struct FastOut {
char buf[1 << 26]; // 64MB
char* pos = buf;
~FastOut() {
fwrite(buf, 1, pos - buf, stdout);
}
void printNum(unsigned int x) {
if (x == 0) {
*pos++ = '0';
return;
}
char rev[20];
int len = 0;
while (x > 0) {
rev[len++] = ('0' + (x % 10));
x /= 10;
}
for (int i = len - 1; i >= 0; i--) {
*pos++ = rev[i];
}
}
} fout;
int main(){
int H = fin.nextNum(), W = fin.nextNum();
int A[H][W];
for (int i = 0; i < H; i++){
for (int j = 0; j < W; j++){
A[i][j] = fin.nextNum();
}
}
unsigned int S[H];
for (int i = 0; i < H; i++){
S[i] = 0;
for (int j = 0; j < W; j++){
S[i] += A[i][j];
}
}
unsigned int T = 0;
for (int i = 0; i < H; i++){
T += S[i];
}
for (int i = 0; i < H; i++){
fout.printNum(S[i] + T);
*fout.pos++ = '\n';
}
}