結果

問題 No.3677 Global Checksum
コンテスト
ユーザー cho435
提出日時 2026-09-05 00:27:22
言語 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
結果
RE  
実行時間 -
コード長 1,787 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,287 ms
コンパイル使用メモリ 352,860 KB
実行使用メモリ 9,784 KB
最終ジャッジ日時 2026-09-05 00:27:36
合計ジャッジ時間 6,384 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#pragma GCC target("prefer-vector-width=512")
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>

#include <sys/mman.h>
#include <sys/stat.h>

namespace fastio {
using namespace std;
static char* p;
void init() {
	struct stat st;
	fstat(0, &st);
	p = (char*)mmap(0, st.st_size, PROT_READ, MAP_SHARED, 0, 0);
}
template <typename T>
inline void rd(T& x) {
	x = 0;
	while (*p < '0' || *p > '9') p++;
	while (*p >= '0' && *p <= '9') {
		x = x * 10 + (*p - '0');
		p++;
	}
}
static char outbuf[1 << 20];
int out_p = 0;
inline void flush() {
	if (out_p) fwrite(outbuf, 1, out_p, stdout);
	out_p = 0;
}
inline void put(char c) {
	if (out_p == 1 << 20) flush();
	outbuf[out_p++] = c;
}
template <typename T>
inline void wt(T x) {
	if (x == 0) {
		if (out_p == 1 << 20) flush();
		outbuf[out_p++] = '0';
		return;
	}
	static char s[12];
	int i = 0;
	while (x) {
		s[i++] = x % 10 + '0';
		x /= 10;
	}
	while (i--) {
		if (out_p == 1 << 20) flush();
		outbuf[out_p++] = s[i];
	}
}
struct D {
	~D() {
		flush();
	}
} d;
}  // namespace fastio

using fastio::put;
using fastio::rd;
using fastio::wt;

// using namespace std;
using ll = long long;
#define rep(i, s, t) for (int i = s; i < (int)(t); i++)
#define all(x) begin(x), end(x)
template <class T> bool chmin(T& x, T y) {
	return x > y ? (x = y, true) : false;
}
template <class T> bool chmax(T& x, T y) {
	return x < y ? (x = y, true) : false;
}

using u32 = uint32_t;
std::array<u32, 4'000'000> a;
std::array<u32, 1'000'000> s;

int main() {
	u32 t = 0;

	u32 h, w;
	rd(h);
	rd(w);
	// std::cin >> h >> w;
	rep(i, 0, h * w) rd(a[i]);
	// rep(i, 0, h * w) std::cin >> a[i];
	rep(i, 0, h) rep(j, 0, w) s[i] += a[i * w + j];
	rep(i, 0, h) t += s[i];
	rep(i, 0, h) {
		wt(s[i] + t);
		put('\n');
		// std::cout << (s[i] + t) << '\n';
	}
}
0