結果
| 問題 | No.3677 Global Checksum |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-09-06 15:04:47 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 746 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 52,140 KB |
| 実行使用メモリ | 27,264 KB |
| 最終ジャッジ日時 | 2026-09-06 15:05:05 |
| 合計ジャッジ時間 | 12,970 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 8 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3677.cc: No.3677 Global Checksum - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_H = 1000000;
const int MAX_HW = 4000000;
const long long MASK = (1LL << 32) - 1;
/* typedef */
using ll = long long;
/* global variables */
int as[MAX_HW];
ll ss[MAX_H];
/* subroutines */
/* main */
int main() {
int h, w;
scanf("%d%d", &h, &w);
int hw = h * w;
for (int i = 0; i < hw; i++) scanf("%d", as + i);
ll t = 0;
for (int i = 0, u = 0; i < h; i++) {
for (int j = 0; j < w; j++, u++) ss[i] += as[u];
ss[i] &= MASK;
t += ss[i];
}
t &= MASK;
for (int i = 0; i < h; i++)
printf("%lld\n", (ss[i] + t) & MASK);
return 0;
}
tnakao0123