CF405C.Unusual Product

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first line of input contains an integer nn ( 1<=n<=10001<=n<=1000 ), the number of rows and the number of columns in the matrix AA . The next nn lines describe the matrix: the ii -th line contains nn space-separated bits and describes the ii -th row of AA . The jj -th number of the ii -th line aija_{ij} ( 0<=aij<=10<=a_{ij}<=1 ) is the element on the intersection of the ii -th row and the jj -th column of AA .

The next line of input contains an integer qq ( 1<=q<=1061<=q<=10^{6} ), the number of queries. Each of the next qq lines describes a single query, which can be one of the following:

  • 1 ii — flip the values of the ii -th row;
  • 2 ii — flip the values of the ii -th column;
  • 3 — output the unusual square of AA .

Note: since the size of the input and output could be very large, don't use slow output techniques in your language. For example, do not use input and output streams (cin, cout) in C++.

输入格式

Let the number of the 3rd type queries in the input be mm . Output a single string ss of length mm , where the ii -th symbol of ss is the value of the unusual square of AA for the ii -th query of the 3rd type as it appears in the input.

输出格式

输入输出样例

  • 输入#1

    3
    1 1 1
    0 1 1
    1 0 0
    12
    3
    2 3
    3
    2 2
    2 2
    1 3
    3
    3
    1 2
    2 1
    1 1
    3
    

    输出#1

    01001
    
首页