結果
| 問題 | No.3430 Flip the Grid |
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2026-01-11 15:16:53 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 411 ms / 2,000 ms |
| コード長 | 959 bytes |
| 記録 | |
| コンパイル時間 | 1,072 ms |
| コンパイル使用メモリ | 112,100 KB |
| 実行使用メモリ | 34,816 KB |
| 最終ジャッジ日時 | 2026-01-11 15:16:58 |
| 合計ジャッジ時間 | 3,918 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <atcoder/modint>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;
using namespace atcoder;
using mint = modint998244353;
typedef vector<int> Vec;
typedef vector<Vec> Mat;
void printMat(Mat mat) {
int i, j;
rep(i, mat.size()) {
rep(j, mat[i].size()) {
cout << mat[i][j];
if (j + 1 < mat[i].size()) cout << " ";
}
cout << endl;
}
}
signed main() {
int n, m;
cin >> n >> m;
Mat a(n, Vec(m));
int i, j;
rep(i, n) rep(j, m) scanf("%lld", &a[i][j]);
int res1 = 0;
rep(i, n) {
int x = 0;
rep(j, m) x ^= a[i][j];
res1 += x;
}
int res2 = 0;
rep(j, m) {
int x = 0;
rep(i, n) x ^= a[i][j];
res2 += x;
}
cout << max(res1, res2) << endl;
return 0;
}
startcpp