結果

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

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
struct FastCin{static constexpr int S=1<<25;char b[S+32],*p=b;FastCin(){size_t n=fread(b,1,S,stdin);memset(b+n,0,32);}inline FastCin&operator>>(int&x){while(*p<'0'||*p>'9')++p;x=0;do{x=x*10+*p++-'0';}while(*p>='0'&&*p<='9');return *this;}};
struct FastCout{static constexpr unsigned int S=1<<24;char b[S],*p=b;~FastCout(){fwrite(b,1,p-b,stdout);}inline FastCout&operator<<(char c){*p++=c;return *this;}inline FastCout&operator<<(unsigned int x){char*q=p;if(!x){*p++='0';return*this;}unsigned int n=0,y=x;while(y)y/=10,++n;p+=n;for(char*r=p;r!=q;)*--r='0'+x%10,x/=10;return*this;}};
FastCin Cin;
FastCout Cout;
int main(){
	int H, W;
	Cin >> H >> W;
	int A[H][W];
	for (int i = 0; i < H; i++){
		for (int j = 0; j < W; j++){
			Cin >> A[i][j];
		}
	}
	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++){
		Cout << (S[i] + T) << '\n';
	}
}
0