結果
| 問題 | No.3677 Global Checksum |
| コンテスト | |
| ユーザー |
lmori
|
| 提出日時 | 2026-09-04 23:39:20 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 5,222 bytes |
| 記録 | |
| コンパイル時間 | 2,625 ms |
| コンパイル使用メモリ | 377,792 KB |
| 実行使用メモリ | 9,788 KB |
| 最終ジャッジ日時 | 2026-09-04 23:39:45 |
| 合計ジャッジ時間 | 6,900 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 TLE * 1 -- * 6 |
ソースコード
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using ull = unsigned long long;
using ld = long double;
using int128 = __int128_t;
#define all(x) (x).begin(), (x).end()
#define EPS 1e-8
#define uniqv(v) v.erase(unique(all(v)), v.end())
#define OVERLOAD_REP(_1, _2, _3, name, ...) name
#define REP1(i, n) for (auto i = std::decay_t<decltype(n)>{}; (i) < (n); ++(i))
#define REP2(i, l, r) for (auto i = (l); (i) < (r); ++(i))
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP2, REP1)(__VA_ARGS__)
#define log(x) cout << x << endl
#define logfixed(x) cout << fixed << setprecision(10) << x << endl;
#define logy(bool) \
if (bool) { \
cout << "Yes" << endl; \
} else { \
cout << "No" << endl; \
}
ostream& operator<<(ostream& dest, __int128_t value) {
ostream::sentry s(dest);
if (s) {
__uint128_t tmp = value < 0 ? -value : value;
char buffer[128];
char* d = end(buffer);
do {
--d;
*d = "0123456789"[tmp % 10];
tmp /= 10;
} while (tmp != 0);
if (value < 0) {
--d;
*d = '-';
}
int len = end(buffer) - d;
if (dest.rdbuf()->sputn(d, len) != len) {
dest.setstate(ios_base::badbit);
}
}
return dest;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << (i + 1 != (int)v.size() ? " " : "");
}
return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& set_var) {
for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
os << *itr;
++itr;
if (itr != set_var.end()) os << " ";
itr--;
}
return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& map_var) {
for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
os << itr->first << " -> " << itr->second << "\n";
}
return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& pair_var) {
os << "(" << pair_var.first << ", " << pair_var.second << ")";
return os;
}
void out() { cout << '\n'; }
template <class T, class... Ts>
void out(const T& a, const Ts&... b) {
cout << a;
((cout << ' ' << b), ...);
cout << '\n';
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
for (T& in : v) is >> in;
return is;
}
inline void in(void) { return; }
template <typename First, typename... Rest>
void in(First& first, Rest&... rest) {
cin >> first;
in(rest...);
return;
}
template <typename T>
bool chmax(T& a, const T& b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
if (a > b) {
a = b;
return true;
}
return false;
}
vector<lint> dx8 = {1, 1, 0, -1, -1, -1, 0, 1};
vector<lint> dy8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<lint> dx4 = {1, 0, -1, 0};
vector<lint> dy4 = {0, 1, 0, -1};
#line 2 "other/scanner.hpp"
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <string>
#include <type_traits>
#include <vector>
/**
* @brief Scanner(高速入力)
*/
struct Scanner {
public:
explicit Scanner(std::FILE* fp) : fp(fp) {}
template <typename T, typename... E>
void read(T& t, E&... e) {
read_single(t);
read(e...);
}
private:
static constexpr std::size_t line_size = 1 << 16;
static constexpr std::size_t int_digits = 20;
char line[line_size + 1] = {};
std::FILE* fp = nullptr;
char* st = line;
char* ed = line;
void read() {}
static inline bool is_space(char c) { return c <= ' '; }
void reread() {
std::ptrdiff_t len = ed - st;
std::memmove(line, st, len);
char* tmp = line + len;
ed = tmp + std::fread(tmp, 1, line_size - len, fp);
*ed = 0;
st = line;
}
void skip_space() {
while (true) {
if (st == ed) reread();
while (*st && is_space(*st)) ++st;
if (st != ed) return;
}
}
template <typename T, std::enable_if_t<std::is_integral<T>::value, int> = 0>
void read_single(T& s) {
skip_space();
if (st + int_digits >= ed) reread();
bool neg = false;
if (std::is_signed<T>::value && *st == '-') {
neg = true;
++st;
}
typename std::make_unsigned<T>::type y = *st++ - '0';
while (*st >= '0') {
y = 10 * y + *st++ - '0';
}
s = (neg ? -y : y);
}
template <typename T,
std::enable_if_t<std::is_same<T, std::string>::value, int> = 0>
void read_single(T& s) {
s = "";
skip_space();
while (true) {
char* base = st;
while (*st && !is_space(*st)) ++st;
s += std::string(base, st);
if (st != ed) return;
reread();
}
}
template <typename T>
void read_single(std::vector<T>& s) {
for (auto& d : s) read(d);
}
};
// https://ei1333.github.io/library/other/scanner.hpp
int main() {
cin.tie(0)->sync_with_stdio(0);
uint32_t h, w;
Scanner scanner(stdin);
scanner.read(h, w);
vector<uint32_t> s(h, 0);
uint32_t a;
uint32_t t = 0;
rep(i, h) {
rep(j, w) {
scanner.read(a);
s[i] += a;
}
t += s[i];
}
rep(i, h) out(t + s[i]);
}
lmori