電泡泡

## Problem J: Matrix Operation

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 52   Solved: 24
[ Submit][ Status][ Web Board]

## Description

You are given a matrix M of type 1234x5678. It is initially filled with integers 1...1234x5678 in row major
order. Your task is to process a list of commands manipulating M. There are 4 types of commands:
"R x y" swap the xth and yth row of M; 1<=x, y<=1234.
"C x y" swap the xth and yth column of M; 1<=x, y<=5678.
"Q x y" write out M(x, y); 1<=x<=1234.1<=y<=5678.
"W z" write out x and y where z=M(x, y). 1<=z<=7006652 (1234 * 5678)

## Input

The input file contains several test cases. The first line is N: the number of test cases. Then follows N lines.
A list of valid commands.1 <= N <= 10000.

## Output

For each "Q x y" write out one line with the current value of M(x, y), for each "W z" write out one line with
the value of x and y (described as above) separated by a space.

10

R 1 2

Q 1 1

Q 2 1

W 1

W 5679

C 1 2

Q 1 1

Q 2 1

W 1

W 5679

## Sample Output

5679

1

2 1

1 1

5680

2

2 2

1 2

### 電泡泡

1、定义关联数组 磁盘分区（键） 利用率（值）；键值对先存放的后取出 2、将下图所示，实现转置矩阵matrix.sh1 2 3 1 4 74 5 6 ===> 2 5 87 8 9 3 6 9...

51tanxiaojun
2017/12/26
0
0
C语言二维动态数组指针问题

// juzhen 2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdlib.h" typedef struct mat { int nRow; /* 行数 */ int nCol; /* 列数 */......

2015/07/29
132
1
R语言－强大的矩阵运算

1 矩阵基本操作 1.1创建向量 R里面有多种方法来创建向量（Vector），最简单的是用函数c()。例如： >X=c(1,2,3,4) >X [1] 1 2 3 4 当然，还有别的方法。例如： >X=1:4 >X [1] 1 2 3 4 还有seq...

openthings
2015/12/16
170
0
Course4-week1-convolutional neural network

_席达_
2018/06/09
0
0

（b）表中的0.56等数字，暂时按照0,1录入 aaa=matrix(nrow=50,ncol=2) #生成第一个对应cc.yes和cc.no的矩阵aaa for (i in 1:50) { #按行循环50次 j=sample(c(1:2),1) #在1和2中随机抽取一个数...

pbyang
2014/01/07
0
0

Netty如何实现Reactor模式

28分钟前
2
0

Fundebug
29分钟前
2
0

_Change_
38分钟前
0
0
php简易缓存函数

xiaogg
42分钟前
0
0
linux 使用文件增加虚拟内存 swap

46分钟前
3
0