結果
| 問題 |
No.1870 Xor Matrix
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-11 22:18:43 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 2,000 ms |
| コード長 | 473 bytes |
| コンパイル時間 | 424 ms |
| コンパイル使用メモリ | 36,608 KB |
| 最終ジャッジ日時 | 2025-01-28 08:43:56 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d %d", &N, &M);
| ~~~~~^~~~~~~~~~~~~~~~~
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d", &tmp);
| ~~~~~^~~~~~~~~~~~
main.cpp:16:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &tmp);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include<cstdio>
#include<atcoder/modint>
using namespace atcoder;
using Mint = modint998244353;
int main(){
int N, M;
scanf("%d %d", &N, &M);
int A = 0, B = 0;
for (int i = 0; i < N; i++){
int tmp;
scanf("%d", &tmp);
A ^= tmp;
}
for (int i = 0; i < M; i++){
int tmp;
scanf("%d", &tmp);
B ^= tmp;
}
if(A != B) printf("0\n");
else printf("%u\n", Mint::raw(2).pow(20LL*(N-1)*(M-1)).val());
}