Universal Cup Judging System

Universal Cup

시간 제한: 2.0 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓
통계

มีเมทริกซ์ $A = (A_{i,j})$ ($1 \le i \le N, 1 \le j \le M$) ขนาด $N$ แถว $M$ คอลัมน์ที่ประกอบด้วย $0$ และ $1$ เท่านั้น อยู่ทั้งหมด $2^{NM}$ เมทริกซ์ ในบรรดาเมทริกซ์เหล่านี้ จงหาจำนวนเมทริกซ์ที่สอดคล้องกับเงื่อนไขต่อไปนี้ และแสดงผลลัพธ์มอดุโล $998244353$

  • สำหรับทุก $k = 1, 2, \dots, K$ เงื่อนไขทั้งสองข้อต่อไปนี้เป็นจริง:
    • $\sum_{i=1}^{x_k} \sum_{j=1}^{y_k} A_{i,j}$ เป็นจำนวนคี่
    • $\sum_{i=x_k+1}^{N} \sum_{j=y_k+1}^{M} A_{i,j}$ เป็นจำนวนคี่

ข้อมูลนำเข้า

ข้อมูลนำเข้าจะให้มาในรูปแบบต่อไปนี้:

N M
K
x1 y1
x2 y2
:
xK yK
  • $2 \le N, M \le 10^9$
  • $1 \le K \le 3 \times 10^5$
  • $1 \le x_i < N$ ($1 \le i \le K$)
  • $1 \le y_i < M$ ($1 \le i \le K$)
  • $(x_i, y_i) \ne (x_j, y_j)$ ($i \ne j$)
  • ค่าข้อมูลนำเข้าทั้งหมดเป็นจำนวนเต็ม

ข้อมูลส่งออก

พิมพ์คำตอบ

ตัวอย่าง

ข้อมูลนำเข้า 1

3 4
2
2 2
1 3

ข้อมูลส่งออก 1

256

ข้อมูลนำเข้า 2

76 38
4
7 6
3 8
20 26
3 28

ข้อมูลส่งออก 2

361562686

หมายเหตุ

สำหรับข้อมูลนำเข้าตัวอย่างแรก เมทริกซ์ด้านบนในรูปสอดคล้องกับเงื่อนไข อย่างไรก็ตาม เมทริกซ์ด้านล่างไม่สอดคล้องกับเงื่อนไขเนื่องจาก $\sum_{i=1}^{x_1} \sum_{j=1}^{y_1} A_{i,j}$ เป็นจำนวนคู่

problem_17419_1.png

รูปที่ 1: คำอธิบายสำหรับตัวอย่างแรก

สำหรับตัวอย่างที่สอง อย่าลืมแสดงคำตอบมอดุโล $998244353$

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#1483EditorialOpen题解jianglyView
#1341EditorialOpen题解MilmonView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.