結果
| 問題 |
No.2702 Nand Nor Matrix
|
| コンテスト | |
| ユーザー |
鴨志田卓
|
| 提出日時 | 2024-04-02 12:07:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 791 bytes |
| コンパイル時間 | 2,030 ms |
| コンパイル使用メモリ | 192,616 KB |
| 最終ジャッジ日時 | 2025-02-20 19:36:35 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 43 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, w, h, a[N], b[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for(int i = 1; i <= n; i ++) {
cin >> a[i];
}
for(int i = 2; i <= n; i ++) {
cin >> b[i];
}
if(a[2] == b[2]) {
for(w = 2; w < n && a[w] != a[w + 1]; w ++);
for(h = 2; h < n && b[h] != b[h + 1]; h ++);
}
int q;
cin >> q;
for(int i = 1; i <= q; i ++) {
long long t;
int x, y;
cin >> t >> x >> y;
if(x == 1) cout << a[y] << "\n";
else if(y == 1) cout << b[x] << "\n";
else if(x <= w && y <= h && t >= x + y - 3) cout << ((a[2] ^ (x + y - 3)) & 1) << "\n";
else cout << (t & 1) << "\n";
}
}
鴨志田卓