結果

問題 No.3677 Global Checksum
コンテスト
ユーザー t98slider
提出日時 2026-09-05 02:09:58
言語 C++23
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 1,054 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 120 ms
コンパイル使用メモリ 41,536 KB
実行使用メモリ 9,772 KB
最終ジャッジ日時 2026-09-05 02:10:13
合計ジャッジ時間 4,228 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 TLE * 1 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdint.h>
char *p1,*p2,buf[1 << 19];
#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1 << 19,stdin),p1==p2)?EOF:*p1++)
uint32_t read(){
	uint32_t x = 0;
	char c = gc();
	while(c < 48) c = gc();
    while(c > 47) x = (x << 3) + (x << 1) + (c & 15), c = gc();
	return x;
}

size_t outpos = 0;
void pc(char c){
    if(outpos == sizeof(buf)){
        fwrite(buf, 1, outpos, stdout);
        outpos = 0;
    }
    buf[outpos++] = c;
}

void write(uint32_t x){
    char s[10];
    int n = 0;
    do {
        s[n++] = '0' + x % 10;
        x /= 10;
    } while(x);
    while(n) pc(s[--n]);
    pc('\n');
}

int main(){
    uint32_t h = read(), w = read(), tot = 0;
    uint32_t S[h];
    for(uint32_t y = 0; y < h; y++){
        S[y] = read();
        if(1 < w) S[y] += read();
        if(2 < w) S[y] += read();
        if(3 < w) S[y] += read();
        for(int x = 4; x < w; x++) S[y] += read();
        tot += S[y];
    }
    for(uint32_t i = 0; i < h; i++){
        write(tot + S[i]);
    }
    fwrite(buf, 1, outpos, stdout);
}
0