Logo
(追記) (追記ここまで)

17992번 - Computer Cache 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 (추가 시간 없음) 512 MB76342646.429%

문제

Your computer has a cache consisting of n different addresses, indexed from 1 to n. Each address can contain a single byte. Initially all cache bytes start off with the value zero.

You have m different pieces of data you want to store. Each piece of data is a byte array. The pieces of data may have different lengths, and any particular piece of data may be stored multiple times at different locations.

You are going to do q operations on your computer. There are three types of operations:

  • 1 i p Load piece of data i starting at position p in the cache. This overwrites any previously stored value in the cache. It is guaranteed that this is a valid operation (i.e., the data will not go beyond the end of the cache). It is possible for multiple versions of some data to be loaded in multiple positions of the cache at once.
  • 2 p Print the byte that is stored in cache address p.
  • 3 i l r Increment the lth through rth bytes in the ith piece of data. Since these are bytes, you must increment modulo 256. This does not affect values that are already loaded in the cache. It only affects the piece of data, and future loads of the piece of data.

입력

The first line of input contains three integers n, m and q (1 ≤ n, m, q ≤ 5 ∙ 105), where n is the size of the computer’s cache, m is the number of pieces of data, and q is the number of operations.

Each of the next m lines describes a piece of data, as a sequence of space separated integers. The first integer on the line, ki (1 ≤ ki, ∑ki ≤ 5 ∙ 105), indicates the number of integers to follow. Each of the next ki integers x (0 ≤ x ≤ 255) are the contents of the piece of data.

Each of the next q lines will have two, three, or four space-separated integers representing an operation, in order, as described above. Either:

1 i p or 2 p or 3 i l r

With (1 ≤ im), (1 ≤ pn), and (1 ≤ lrki). There is guaranteed to be at least one 2 operation.

출력

For each 2 operation, output the integer value of cache location p, one per line.

제한

예제 입력 1

5 2 10
3 255 0 15
4 1 2 1 3
2 1
1 2 2
1 1 1
2 1
2 4
3 1 1 2
2 1
1 1 2
2 2
2 5

예제 출력 1

0
255
1
255
0
3

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2019 Southeast USA Regional Programming Contest > Division 1 B번

ICPC > Regionals > North America > Pacific Northwest Regional > 2019 ICPC Pacific Northwest Region > Division 1 K번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /